All Questions



Why to precise velocity.y and not simply velocity?

I Nathan I don't understand why you use velocity.y = move_and_slide_with_snap(...).y,

and not velocity = move_and_slide_with_snap(...)?

I tried the two and didn't notice any changing within the player movement.

  • Nathan Lovato replied

    With the project's code, if I recall correctly, your suggestion would make enemies get stuck on walls, as they rely on their current velocity to change direction. Only resetting the Y velocity prevents that bug.

  • M
    RMDS replied

    Thank you Nathan! I tested with the enemy and yes it is exactly as you said!