About 'Flip Character Sprite'!

In this video (objectives)…

  1. Introduce Mathf.Abs and Mathf.Sign.
  2. Pseudocode for flipping character sprite.
  3. Flip character sprite based upon player having horizontal velocity.

After watching (learning outcomes)…

Flip the player character's sprite whenever the character has horizontal velocity.

(Unique Video Reference: 11_TV_CUD)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

1 Like

Might be nice to mention in passing why > Mathf.Epsilon is preferred over > 0. I’m assuming it is due to a potential float rounding issue when the rigid body is at rest but velocity is not quite exactly 0?

Great point. Because this section was originally in the 3D course, Ben had mentioned a couple of times about “why epsilon”. I’ll make sure to be clear as I’m remastering the 2D course what epsilon is about.

You are exactly correct with your assumption. Because is very tiny rounding issues, we cant assume that a value is actually exaclty 0.

1 Like

Privacy & Terms