Error With Cinemachine Path and Dolly
Hi everyone, i'm using cinemachine for making a sidescroller game, and my virtual camera is attached to a dolly on path. I control the position of dolly in a script. At beggining is working, and suddenly unity send this error for the PathBase script (i don't touch this script) :
IndexOutOfRangeException: Index was outside the bounds of the array. Cinemachine.CinemachinePathBase.ToNativePathUnits (System.Single pos, Cinemachine.CinemachinePathBase+PositionUnits units) (at Library/PackageCache/com.unity.cinemachine@2.6.0/Runtime/Core/CinemachinePathBase.cs:292) Cinemachine.CinemachinePathBase.EvaluatePositionAtUnit (System.Single pos, Cinemachine.CinemachinePathBase+PositionUnits units) (at Library/PackageCache/com.unity.cinemachine@2.6.0/Runtime/Core/CinemachinePathBase.cs:188) Cinemachine.CinemachineDollyCart.SetCartPosition (System.Single distanceAlongPath) (at Library/PackageCache/com.unity.cinemachine@2.6.0/Runtime/Behaviours/CinemachineDollyCart.cs:78) Cinemachine.CinemachineDollyCart.Update () (at Library/PackageCache/com.unity.cinemachine@2.6.0/Runtime/Behaviours/CinemachineDollyCart.cs:62)
The line of the script : return MinPos + Mathf.Lerp(m_DistanceToPos[i], m_DistanceToPos[i+1], t);
I don't understand why sounddenly have an error... Thanks for help !