Search Unity

Camera Rotates Upon Play Button Clicked

Discussion in 'Editor & General Support' started by MerlinG2, Jun 17, 2020.

  1. MerlinG2

    MerlinG2

    Joined:
    Jun 17, 2020
    Posts:
    44
    So I'm trying to make a first-person game so I've placed a camera inside a cylinder, which I'm using as a body for now, and for some reason every time I click play to load the scene, the camera rotates to the right a fair amount. When I stop testing it, the camera resets and I'm not moving my mouse when it starts so it can't be that. The rest of the player doesn't move, only the camera does. I'm using Unity 2018.4.23f1. I would greatly appreciate some help and just so you know, I'm relatively new to unity.

    Cheers.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    So it will only rotate if it is told to rotate. That would be caused by either a physics interaction (if a rigidbody is involved) or by a script or other component telling it to rotate. I have no idea what you have attached to the camera or what other things reference this camera, so can't really speculate further.
     
  3. MerlinG2

    MerlinG2

    Joined:
    Jun 17, 2020
    Posts:
    44
    Okay, thanks for letting me know. I'll see if it is caused by those things
     
  4. MerlinG2

    MerlinG2

    Joined:
    Jun 17, 2020
    Posts:
    44
    I can't find the issue however I have narrowed it down to this script. unity help.png
    Maybe I'm just being dumb but I don't know what it could be.