Search Unity

Transition from VirtualCamera to FreeLook: Match position & Rotation

Discussion in 'Cinemachine' started by theghostronaut, Nov 26, 2021.

  1. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    41
    I'm transitioning from a VirtualCamera to a FreeLook camera. The situation is, the player is watching a short in-game cutscene and then gets back control of the camera. I'm using the Priority system to switch cameras via script.

    My problem is, when switching to the FreeLook camera, it gets positioned behind the LookAt target immediately. I would like it to match the position, rotation and facing direction of the previous VirtualCamera, so that the transition between the two is completely smooth (and only when the player moves the mouse/joystick the cameras position & rotation changes).

    I tried just setting the position and rotation of the FreeLook camera after the switch, but this doesn't seem to have any effect as both seem to be constantly overwritten by the Cinemachine internals.

    Is there a way I could achieve this?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    What is the Binding Mode of the FreeLook?
     
  3. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    41
    It is currently set to World Space, but changing binding modes doesn‘t seem to affect the behaviour.

    I just realised checking „Inherit position“ positions the camera after the switch in roughly the right spot, but its still not the exact same view as the previous virtual camera.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Yes, InheritPosition will to that. It puts the FreeLook at the spot where the outgoing vcam was, and then sets its axes appropriately. However, the FreeLook will then move to respect the orbits and radii you have set up. Can you show a video of the problem?
     
  5. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    41
    My bad — I still had the transition set to Cut. Checking Inherit Position + a smooth transition works perfectly. Thanks!
     
    Gregoryl likes this.
  6. Carlos_7x

    Carlos_7x

    Joined:
    Jan 19, 2017
    Posts:
    16
    Is anyone still facing this issue? I can't find the InheritPosition
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711