Handle root motion with StateStore

Hello all,
I’ve been working on my Co-op RPG for quite a while and managed to stimulate movement, items, skills and so on…

The way I cache all the data is in a Singleton StateStore which can easily be read without additional compmexity.

I’ve recently started to use more animations that rely on Root Motion to be flagged, however applying the root motion breaks the player position state in my store.

Do you guys have a suggestion on how to deal with this?

(The ideal solution would be - to intercept the animation movement and sending to other players)

Thanks all

There’s onApplyRootMotion callback. Also animations applies between update and late update, maybe this help

Thanks for your comment, does onApplyRootMotion apply for the transform with the animator attached or to the child that moved?
And also is there a manual which covers best practices with root motion?

Thanks in advance

this. We’re talking about root motion, it have nothing to do with children

Thank you, I will try using this and update

So I’ve tested OnAnimatorCallback and it seems to be called even when my idle animation is playing (which doesn’t move the transform at all). How do you guys tackle the sync process between clients with Root Motion?