Search Unity

Question How do I fix my player rotation when he's not really rotating?

Discussion in 'Input System' started by faulknordonald, Nov 3, 2023.

  1. faulknordonald


    Sep 9, 2019
    In play mode, as seen in the video, if I push the up and down arrow, my player rotates out of control. But the player game object (and all child objects) aren't actually rotating as seen in the inspector. Player's rotation stays the same, but he's clearly rotating in the game.

    Also, there is no code in this project that says up and down arrow rotates the player, so this must be a default action from the Input System.

    Also, I'm positive it's not the asset doing this, because:
    I first had RobotKyle, created by Unity.
    And now this robot asset.

    Two different assets from two different people/companies and they both act in the same way.

    UPDATE: I noticed when I remove the camera as a child of player, it doesn't do this. So, I'm guessing instead of doing it that way, I need to create a camera follow script.

    UPDATE: The more I mess around with it, the more I realize Cinemachine is stupid. Why would they create cameras that react to arrow and WASD keys? I've determined that my camera is moving (not just following the player), but actually moving based on the keys I press. So, if I have my camera at z position -2, when I press the down arrow, it moves to -10 (approximately).
    Last edited: Nov 3, 2023