Disable Rotating after pressing W and S Keys (2D)

Hello!

I want to make character rotated in direction that Player is moving but when I’m pressing W or S keys, the character rotates in X axis.
Here is video:

2 Likes

You should watch GnomeCode’s 2d platformer tutorial!

1 Like

I don’t want to disable W and S keys.
I want the character to look in the direction the player is going, even after pressing W or S.

Example:

  1. Player pressed D key, and character is looking to the right side
  2. Player holds W or S key, character goes up or down (not Y axis) and is still looking to the right side.
  3. Player pressed A key, and character is looking to the left side
  4. Player holds W or S key, characters goes up or down (not Y axis) and still is looking to the left side.

Then probably change things in thePlayerModule

You could probably turn the AutoRotation off on the humanoid and do your own rotation handling. Just listen to the MoveDirection or check the AssemblyLinearVelocity the player is going and decide which direction the player should look.