I’m loving the instruction so far and am excited to complete the rest of the course! Thank you for your enthusiasm and ease of teaching this stuff.
A couple suggestions on how to make the animation and code a little cleaner:
- You don’t need four transitions if you simply check the absolute value of the move vector’s magnitude. You can check if it’s greater/less than a small value to transition from the idle/run animation with one variable instead of four that way.
- Maybe this comes later, but should probably normalize the move vector or diagonal movement would be faster than in a cardinal direction.
- Since the flip test is making a boolean check and the response is setting another boolean value, you can clean that up by simply setting the value to the test. That is:
mySpriteRenderer.flipX = mousePos.x < playerScreenPoint.x