The Mathf part confuses me and maybe someone could try and reexplain it?

I understand most of what is going on but it’s the last bit where the sprite stays flipped that I simply can’t get my head around that someone might be able to explain in simpler terms? I understand how it makes sense to use a bool to check if we’re moving. I understand that Mathf.Abs disregards negative values and returns only positives. I understand that to check if is bigger than 0, but using Mathf.Epsilon instead, which is very close but not quite zero.

But why does that make the sprite stay flipped? My brain refuses to comprehend why this happens so someone please try and make me understand.

It’s because nothing changes the scale if we are not moving, so the scale remains 1 or -1 on the x axis. We’ve changed it and that’s how it stays until we change it again.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms