hi I’m making a top down view game with basic player controls as I’m still fairly new to unity. I’m trying to get the player to rotate to face the direction they will move in. I’ve tried a lot of different ways to try and get it to work from things I’ve researched myself but just cant seem to get it to work properly I would really apricate if someone could help me out with this here is the current player movement method I’m using but it doesn’t rotate at all
You are rotating on the Y axis you need to rotate on the Z axis.
transform.eulerAngles.Set(0, rotateLeft, 0);
should be:
transform.eulerAngles.Set(0, 0, rotateLeft);
Just put either of the scripts on your player and you’re good to go The second version only rotates player in left and right direction on left and right arrow keys and only moves forwards/backwards on up and down arrow keys.
PS: if you want to change sensitivity just change “speed” value for movement or the “1” or “-1” to other values for rotation