Cinemachine Dolly Cam Change Spline at Runtime

Hello i have a problem with chnaging a Spline of a CineMachineSplineDolly at Runtime.
I have one Camera that adds knots to a spline at runtime and follows that curve. Than the Camera gets deactivatet at the end of the Path and another Cmera is active. While the other camera is active i change the knots of the Spline from the first Cam and set the Position in the Cinemachine SplineDolly to 0. And then reactivate the Dolly Cam but even though the new Spline is correctly set and is correct visible in the Editor the Dolly Cam follows the first Spline that i have overwritten. Can anyone please tell me what i am doing wrong?

If you change knots in the spline at runtime, you need to call CinemachineSplineDolly.SplineSettings.InvalidateCache().

https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/api/Unity.Cinemachine.SplineSettings.html#Unity_Cinemachine_SplineSettings_InvalidateCache

Thank you! That’s what i did not find

1 Like