Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Change camera angle of Third Person Controller

Discussion in 'Editor & General Support' started by megadouwe, Mar 30, 2011.

  1. megadouwe

    megadouwe

    Joined:
    Mar 27, 2011
    Posts:
    15
    Hi All,

    Can someone tell me where I can adjust the angle of the camera for the Third person controller? The camera is by default attached to the back of the character. I want it by default to be attached to the side of the character. So the camera has to be rotaded on the y-axis. I've allready changed several settings in the Third person Camera script, but nothing seems to change.

    Can someone help me with that?

    Thnx!

    With kind regards,

    Douwe
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Line 90 of ThirdPersonCamera.js is:-
    Code (csharp):
    1. var originalTargetAngle = _target.eulerAngles.y;
    If you change this to
    Code (csharp):
    1. var originalTargetAngle = _target.eulerAngles.y + 90.0;
    ...then you are basically adding 90º to the target angle so it will align sideways with the character. You may need to use -90º if you want the camera to look from the other side.
     
  3. megadouwe

    megadouwe

    Joined:
    Mar 27, 2011
    Posts:
    15
    Hi Andeee,

    That did the trick! Thanks!!!!
     
  4. WikiMalik

    WikiMalik

    Joined:
    Nov 13, 2014
    Posts:
    16
    Yes it worked but this is also affecting the forward movement as well. The character now changes direction to the degree of angle change as it moves...?
     
    caden-burleson likes this.