How
do I know if my player is on the path?
When you made your path, you defined its
size; for example, using a width w. If you’re moving your player left and right,
you can keep track how far you’ve moved the player from the centreline.
- If the player’s horizontal distance is
> w/2.0f, the
player is off the right side of the path
- If the player’s horizontal distance is
< -w/2.0f, the
player is off the left side of the path