Unnatural continuous cinemachine camera switching

Here is my situation.

vCam1 is looking at the map from some high position. (Look At = None or Ground)
vCam2 is looking at the Player from the same position (Look At = Player)
vCam3 is looking at the Player behind the Player. (Look At = Player)

And I want to change camera view : vCam1 → vCam2 → vCam3 If I click “change” button.
But Switching Camera view is not natural. (

)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;

public class PrioritySetting : MonoBehaviour
{
    public CinemachineVirtualCamera vCam1, vCam2, vCam3;

    public float time = 2.0f;

    public void GoToVCam3()
    {
        vCam3.Priority = 12;
    }

    public void SwitchCamera()
    {
        vCam2.Priority = 11;
        Invoke("GoToVCam3", time);
    }

    public void RollBack()
    {
        vCam1.Priority = 10;
        vCam2.Priority = 9;
        vCam3.Priority = 9;
    }
}

I want to move the camera naturally while looking at the player at the same time.
It feels like this ↓

-------------------- Time Line ------------------>
vCam1 → vCam2 → vCam3 (X)

vCam1 → vCam2
vCam2 → vCam3 at the same time.

Also I want to turn the camera exactly the opposite path If I click “rollback” button.
vCam3 → vCam2
vCam2 → vCam1 at the same time.

I don’t want to use Dolly Track because the player can be anywhere.

It would be great if you help me on this problem.
Thank you.

If both cameras have the same LookAt target, the camera will continue to look at it during a blend. If the targets differ, then the LookAt point will blend from one position to the other. If one of the cameras has no LookAt target, then only a slerp is possible from one rotation to the other, and that rarely gives natural results.

So, to get maximal control, you should set LookAt targets to all your cameras. Also, you can control how the LookAt point blends using this setting on the cameras:

8453024--1121510--upload_2022-9-20_11-25-10.png

For the overlapped blending, have you tried using a timeline? Put a Cinemachine track on a timeline, create ovlerlapping clips for the 3 camera in a linear fashion. The length of the overlap controls the blend time. Then you can just play the timeline whenever you want.

1 Like

Thank you for your answer.
But I wanted to create an object on runtime, and my camera have to see object, so I gave the example above.
Therefore, if I press the rollback button, I want to cinemacine’s Look At = Ground.

Also, Can I create a timeline and a cinema machine on runtime?

You can create the timeline asset in advance, and bind to the objects at runtime.

Another possible solution is to use CinemachineMixingCamera. That gives you precise control of a continuous blend of up to 8 cameras. You would have to drive their weights manually, perhaps using animation curves.

1 Like

Thank you. I would try mixing camera! have a good day :smile:

1 Like

You can also try BlendListCamera. That might be even better, and simpler.

1 Like

I already tried it with blend list camera, but it was unnatural (such as my video)
Can the blend list run the cinemachine at the same time?

I don’t understand the question.

1 Like

BlendList camera will give you this when it is enabled:
-------------------- Time Line ------------------>
vCam1 → vCam2 → vCam3 (X)

vcam1 should have the ScreenSpaceAim blend hint.
vcam 2 and 3 should have CylidricalPosition blend hint.

1 Like

I tried it!, But it still is unnatural, because vCam1 → vCam2 move and stop for a short time.

https://www.youtube.com/watch?v=1I7lKgGeDa8

What happens if you get rid of vcam2, and just blend straight from vcam1 to vcam3? Keep the blend hints.

1 Like

Thank you!, It helps me a lot.
I solve my problem.
Again, Thank you for your help!!

https://www.youtube.com/watch?v=BpXTBnGH-e8

1 Like

So now you don’t need the BlendList camera, you can just do normal blends.

I understand,
I just change priority of vCam1 now, right?

Yes.

FYI it is also possible to set all the vcams to the same priority, then do vcam.MoveToTopOfPrioritySubqueue() for the vcam that you want to activate. It might not be appropriate for your setup, but it is there if you need it.

Thank you for your tips, I love cinemachine.
Have a good day!

1 Like