Search Unity

How to make character not rotate

Discussion in 'Scripting' started by Treasureman, Aug 1, 2014.

  1. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    I'm making a third person shooter (using an fps controller.) and I want a script so that the fps controller won't rotate around the camera but WILL face the direction it's moving. But there's more. I also need it so that if you hold in RMB (right click) the camera will zoom in and the character will rotate around the camera (with slight character sway if possible)

    Thanks if you can!
     
  2. lrlelaldl

    lrlelaldl

    Joined:
    Jul 27, 2014
    Posts:
    75
    Never attempted this but I'd suspect that you could just copy down the rotation of the transform component of your camera to get the direction that the camera is pointing to and use that. As for the rotating around the camera, you could do gemotric math to figure out where it should be?