We decided to use Cinemachine as our camera solution and we are facing a weird blend behaviour.
As you can see, when enabling the second virtual camera, instead of blending the camera target smoothly, it keep looking at the first target at the beginning of the blend and then switch to the second target.
In fact this is the intended behaviour. When you blend between vcams with different LookAt targets, the LookAt point during the blend is not a linear lerp between the target points (which is what you are looking for, I believe). Instead, it is a spherical linear interpolation that is more robust under more circumstances.
There are 2 ways to change this.
Remove the LookAt target from one or both of your vcams. This will force CM to simply slerp the camera rotations, giving you the effect you want in this case, or
Change the way CM interpolates the LookAt target. Go to CameraState.cs, around line 170 or so, and make this mod:
Please let me know how that works out for you, and whether the mod creates other blending weirdnesses. There is some controversy here about what is the best blending strategy for the LookAt target, and we might have to make this choice more explicit in future releases. Thanks.
Thanks for sharing that trick. I know this is an old thread, but It would be great if this were exposed as an option in the future. I found it helped smooth out some camera weirdness related to blending from a view looking out to one side back to a follow cam behind a moving object. I can send you more details if you’re interested. Thanks! We’re really enjoying the new tools!
I did encounter some weird blend that occur when the start and the end point have opposite forward. This blend is between a Virtual Camera as a tracked dolly (not auto) and a cinemachine external camera
I can’t really tell what’s happening here since you didn’t show Hierarchy/Inspector windows.
Could you upload this/make repo project and send it to @Gregoryl / @Adam_Myhill , It would really help.
Thanks.
Ok, unfortunately I can’t make a repo because we have an internal git but I’ve made a showcase (unity project). I will send it by PM to @Gregoryl .
The problems is due to Cinemachine attempting to negotiate a difficult blend (one that involves a travelling Lerp right through the object being looked at) without sufficient information to do it properly.
The CinemachineExternalCamera, while useful in some situations, is lacking a key piece of essential information: the LookAt target. The blender needs to know what the camera is looking at, otherwise it’s stuck doing what is essentially a Slerp, which can give inferior results in circumstances such as these.
I would suggest, instead of using CinemachineExternalCamera, that you add a CinemachineVirtualCamera to the Player Orbital camera. Sets its aim and body to Hard Constraint, and - importantly - set its lookAt target to the point that the Player Orbital camera is looking at. Then the blends will be nice.
Another (perhaps better) option is to just add the LookAt field to the CinemachineExternalCamera, to provide the missing information. I’ve done that here, and it seems to do the trick in your scene.
So I did try both solutions and they both work. But I have a question does the lookAt in cinemachineExternalCamera will be added in a further version ? (To know if we have to re-apply this when updating cinemachine later on)