Search Unity

Freelook Camera - Orbit with Lock To Target with WorldUp Override

Discussion in 'Cinemachine' started by morphex, Dec 31, 2020.

  1. morphex

    morphex

    Joined:
    Dec 18, 2012
    Posts:
    112
    So I am trying to see if I dont have to implement my own Virtual Camera to do this , but instead use the Orbital Rig one that comes with cinemachine.

    My setup is the following, I have a character that can rotate freely in any direction, and I would like to have a orbital camera around the character, always matching the up to the character up vector.

    I have a Target Game Object as a children my Player Object, which is used to Override the World Up in the Cinemachine Brain.

    The problem arrives when I set the FreeLookCamera BindingMode to LockToTarget. When My character rotates, the camera also rotates instead of staying in place. I have tried the other modes, but if I dont pick BindingMode.LockToTarget, The orbits dont get aligned to the character up.

    For example:
    Camera is looking at Characters Back.
    My Character does a 90 Degree Rotation on Y axis.
    The camera should stay in place and look at the SideView of the character, but instead it rotates WITH the character and keeps looking at the back of the object.


    Is this setup possible at all, or do I actually need to roll my own Custom Logic ? - The implementation its not a issue, I just want to try and use whats already there instead of re inventing the wheel.


    Edit: Like always, I post a question and find the solution 30 mins later. It turns out LockToTarget is the wrong mode, and I should be using Simple Follow With World Up.
     
    Last edited: Dec 31, 2020
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    WorldSpace biding mode is also a possibility.