Search code examples
unity-game-enginegame-physicsgame-developmentgamecontroller

My characters Sensitive. Y Axis is working but not my X Axis


enter image description here I've been following this YouTube video tutorial https://youtu.be/PmIPqGqp8UY and everything was going well my X Axis was working well than I tried working on the Y Axis but for some reason the Y Axis works and now the X doesn't.enter image description here


Solution

  • It looks like you've added your PlayerController script twice, and in one of them, you've added the Player object as a camera.

    See here:
    Player Controller script attached twice

    Try removing the second instance of that from your object.

    Also, as we can't see the left side of your project window it's hard to tell, but you'll also want to confirm that the camera is a child of the player object, because otherwise it won't know to rotate sideways when the player does so.


    By the way, when sharing code, it is much easier for people to read it if you just click the {} button at the top of the textarea and paste your code directly.

    Also, screenshots taken with the Print Screen (PrtSc) button are also much easier to look at than photographs.