• Unity
  • Skeleton Utility Bone Relative/Additive override?

  • Uređeno
Related Discussions
...

Is it possible to add a relative value with the Skeleton Utility Bone override?

So the animation plays, and I always add for example 5 degrees rotation, instead of overriding it completely?

Thanks!

This is not possible with the SkeletonUtilityBone component, since it would be rather strange to have the Transform's absolute rotation or position be added to the current bone rotation or position values.

What you can do is create a component yourself that adds a delta angle to a target bone:

public string boneName;
Bone bone;

void Start() {
    bone = skeletonAnimation.Skeleton.FindBone(boneName);
}

void AddBoneRotation() {
    bone.Rotation += angle;
    bone.AppliedRotation += angle;
}

// then register this method at the skeletonAnimation callback.
skeletonAnimation.UpdateLocal += AddBoneRotation;
// or register it at UpdateWorld or UpdateComplete, depending on when in the update chain you want to change the value

Oh, cool workaround, thanks! 🙂