Cinemachine Target Group Bug

Опубликовано: 27 Июль 2026
на канале: Alvin Ardianto Gozali
1,135
0

Tweening or lerping a target's weight from or to zero, while other existing targets have different weights, will make the target group "ignore" the higher weighted targets and seems to clamp all target's weight to 1.

This is because CinemachineTargetGroup's weight calculation (WeightedMemberBounds) divides each target's weight (w) by the average weight (mAverageWeight) of the target group if the target's weight (w) is below the average weight (mAverageWeight). If the target's weight (w) is above or the same as the average weight (mAverageWeight) the target's weight (w) is clamped to 1.

if (w less than mAverageWeight) {
w = w / mAverageWeight
} else {
w = 1
}

Thus if you add another target with a weight of nearly 0, say 0.002. The average weight will go down which could make nearly all target's weight to be clamped to 1.
This could be avoided or "fixed" if we use the maximum weight of all the target instead of the average weight.