Hello!
Thanks for your continuous testing.
I have some more information to share, but I think this problem may only happen on my mac / specific computers (due to its weird behavior), so maybe the dev team can lower the priority of this issue, or even ignore it.
Also I forgot to say that I’m using m1 pro mac, but Intel edition of Unity Editor instead of Silicon, due to a bug that Silicon Unity Editor can’t load some native dll.
edit: I’ve found another person reported the same bug (Issue UUM-10178), and it has the same environment(m1 mac, but Intel Unity Editor).
For other who may encounter the same problem, a quick solution is to turn the debug mode on (the bug icon in the right bottom of Unity), and it will start behave properly.
So, to find out the reason, I put the Package Cache of Cinemachine 2.8.9 into Assets folder (in order to add Debug.Log()) and Log the calculations to see where the problem is. The problem seems to be at line-217 of CinemachineGroupComposer.cs
, which is calculating the targetDistance local variable for further calculation.
Here comes the weird part. Whenever I Log the targetDistance value to the Console, it immediately behaves normally, like normal dolly, but if I deleted the log line, the issue again appears. (I didn’t change any logic! just logging)
Next, I tried to indirectly get the value of targetDistance by logging the results of the relative calculation, not targetDistance itself.
(sorry for the messy codes)
and it gives me the following log output:
the second line shows “-10 = targetDistance - 10”, which means targetDistance is 0,
but that is literally impossible, because in any condition, targetDistance should be clamped to min value 1.5, due to the first line.
It is like if I don’t check the value of targetDistance, C# won’t calculate targetDistance at all, and leave it to default value 0.
Since the issue is beyond coding, I think there is no short way to fix this.
Turning on the debug mode lets C# “inspect” the value of any local variable for breakpoint-debugging, making the variable be calculated, and hence start working properly.