• Unity
  • Root motion Mecanim

Related Discussions
...

i have posted in this thread the files you need to change

I'll give it a try, thanks. This is with Mecanim right?

I think so

4 Monate später

Hi guys,

I'm trying to implement the bit of code that @BinaryCats (thank you a thousand times for that) wrote, but I'm struggling making it work because I'm a beginner on Spine and the Spine-Unity lib.

I think I have an issue with the setup of the root bone animation maybe :/
I firstly made the main animation on the static character, then I made the root bone moving on the Y axis (my game is a vertical scroller).

Then I imported my character on Unity and in the hierarchy as a SkeletonAnimation. I Setted the default AnimationName as the one I created. And when I push Play I see that my character actually translate on the Y axis but the transform of my character GameObject doesn't have his y axis changing by some wizardry i'm not fimiliar with!

I then added a SkeletonUtility and then spawned a Hierarchy (follow) to fill the RootBone public property with my actual root bone. I could then get a root bone gameobject with a SkeletonUtilityBone component already attached.

I tried after to make the changes ahead on SkeletonUtilityBone and the TranslateTimeline.Apply method, but I still see my character moving up even if my bone get its ax and ay properties set to 0 in the DoUpdate function 🙁

So I'm now looking for someone to help me pointing out my mistake(s) so I can finally get a static object that I can move programmatically by retrieving the StoredBonePos Vector2.

Thank you in advance folks!

Thanks a lot Nate and Pharan, this script works like a charm!
Do you plan to integrate it in the 3.6 version ? I didn't see any mention of that in the release note ^^

Great! :happy: Yes, we should include it in spine-unity so it is more discoverable.