Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Problem with Camera-Movement/Rotation/Angle...

Discussion in 'Scripting' started by Elharter, Jan 11, 2018.

  1. Elharter

    Elharter

    Joined:
    Sep 20, 2015
    Posts:
    45
    Hi Guys,

    i try to realize a camera movement like this one:


    The rotation thing is done and fully working. Ive created a viewport placed in the center of the map and attached the camera in it.

    The main problem is the angle.....if i changed the angle the camera position is moving and all other settings like position.x, position.y, position.z are changing.

    Anyone an idea how can realize the same camera movement like the youtube example?

    thanks
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,713
    I really should make some kinda of copy paste for this answer :)

    I would suggest that you use a 3-part camera
    Rig (empty game object)
    - child Pivot (empty game object)
    - - child Camera (actual camera)

    Now, the Rig only rotates on the y-axis.
    The Pivot only rotates on the local x-axis. (must clamp this value, usually, too)
    and the camera can zoom. (can clamp this value, also)
     
  3. Elharter

    Elharter

    Joined:
    Sep 20, 2015
    Posts:
    45
    Yes this works!!!
    Thanks a lot :)

    Great!
     
  4. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,713
    Cool. Glad I could help. :)

    Enjoy your game.
     
unityunity