- Modifié
bone.ax
Hello
You use to do code:
cachedTransform.localPosition = new Vector3(bone.x, bone.y, 0);
but now you do
cachedTransform.localPosition = new Vector3(bone.ax, bone.ay, 0);
what is this fancy variable?
We use to manually set bone.x = 0;
when we where rootmotion-ing, setting bone.ax
to 0 makes the character move twice as much than normal rootmotion.
our old code in skeletonutilitybone
if (!m_DisablePositionChange)
cachedTransform.localPosition = new Vector3(bone.x, bone.y, 0);
else
{
bone.x = 0;
bone.y = 0;
}
all the "aSomething` fields are applied fields, calculated from the world values. These are used by constraints.
utility bones also use them so they can follow path and transform constrained bones correctly in the new constraint system.
The x, y, etc fields are the local transform that you, an animation, etc sets. The ax, ay, etc fields are the local transform values after constraints have been applied (the "applied local transform"). They are computed only when needed, so before accessing them updateAppliedTransform
must be called if appliedValid
is false. Eg, say a constraint only modifies the world transform (like transform constraint). If no other constraints are applied, the applied transform doesn't need to be computed from the world transform since it isn't used for rendering. If another constraint is applied and it works with local transform values (like IK constraint), then updateAppliedTransform
computes the applied local transform values.
Note the applied local transform is currently not exposed in the public API.
hmm ok thanks