- Modifié
Placing a spine in scene based on a specific bone
Hello!
Normally when you place a spine in Unity the position is based on the “root” bone.
For a particular animation I want to place the spine based on other bone.
Is there a way to do it inside Unity or using code?
My goal is to have a spine animation that is attached (placed) on a specific gameObject.
When the position of the gameObject changes, the position of the spine needs also to be updated.
I don’t know if that actually makes any sense. :think:
DimHoly a écritIs there a way to do it inside Unity or using code?
You can always offset your skeleton GameObject by the difference of the target bone's current position and the position of the "anchor" where it should stick to. An easy way would be to use a separate GameObject with a BoneFollower
Component set to follow the target bone. Then in your script you could translate the position of the SkeletonAnimation GameObject by the difference of the two positions.
To be sure to update the position after the bones have all been updated, you can add your update as a delegate to the SkeletonAnimation.UpdateComplete
event.
I will try it!
Thank you very much!!
Glad it helped!