Hello, here is a video of the problem:
I have 2 virtual Camera of type Transposer, and for each of them they have different Follow & Lookat transform.
When I am transitionning between them, the transition of FOV is working, but not for position… Why is that ?
When I am clicking on my button “Active From Editor” for changing the camera, here what I do in that frame of setup:
- Change the priority of the current camera to 13, and set every other to 12
2) For the current camera: Change the position of the transform Follow & Lookat.
I have tested, it’s my second point who Reset the damping of the position. My Question is: how can I do ?
I want to change at initialisation of an new camera, the position of the follow/lookat (even change the transform objects if I want), without reseting the transition of the cinemachineBrain.
Thanks you !
From the video, it looks to me as though the two vcams have the same Follow and LookAt transforms, and the same Transposer and Composer settings. The only difference is FOV.
You say you are changing the positions of those lookAt and Follow objects. Are you sure you are doing that?
In any case, it might not be the best strategy. If you change the target objects positions, both vcams are targeting them, so they will both snap to new positions at the same time, then you will blend between them. Is that what you want? It might make more sense to use different target objects for the different vcams.
Both VCams use the same Transform for Follow and lookAt. But When I am activating a new Camera, this new camera may have different delta in the follow and lookat (delta is a Vector3 I calculate in editor).
So I change the position of the Follow & Lookat for the new Camera.
But it seems to me with your answer that your code blend from the Follow&Lookat of the camera 1 to the Follow&Lookat of the camera2. And if both Camera have the same transform then I understand the problem.
In my setup I have more than 50 camera which I can activate or not.
So I have created 2 unique transform: a follow_transform, and a Lookat_transform.
And For each of my 50 cameras, I have a script with a delta_follow, and a delta_lookat saved.
When I am activating a new camera: I set the position of my follow_transform& my Lookat_transform to my Vector3 delta_follow & delta_lookat.
Like that: I have only 2 transform in unity, and not 50*2.
But If you tell me that the transition blending can’t work with my settings… I will be forced to create 50 transform follow, and 50 transfrom lookat… Please tell me you have a better solution !
Thanks you for your answer anyway ! Your time & help along my many threads in this forum help us a lot in the developpement of our project.
I’m not sure I understand 100% what you’re trying to do, but here is my interpretation:
- You have a single transform for lookAt, and a single transform for Follow.
- You have multiple vcams targeting these things, but you want each of them to apply a specific offset to the locations of the targets.
- You want to be able to blend freely between the vcams.
Is this correct?
If so, then the answer is simple: put the offsets in transposer.m_FollowOffset and composer.m_TrackedObjectOffset.
The FollowOffset is applied in the space indicated by the binding mode. You have (in the video) set that to LockToTarget, so the offset will be in target local coords.
The composer offset is applied always in target local coords.
If you program the vcams that way with their own offsets, you will not need to reposition anything. The vcams will take care of it automatically, and blending will work properly.
It’s exactly what you understood. You solved my problem. Thank you !
1 Like