Hi,
I don’t use root motions (because of known problems) instead I take inplace animations and simulate moves by dotween.
However sometimes in special animations characters must be moved by animation but after animation is done I need to equate the characters’ position to the animation position.
How can I do that?
up
What I have done in the past is send an animation event when the animation starts to play, that simply records the players position of a specific bone, and then a second animation event at the end that records the end position, and then teleports the player by player.position += endPosition - start Position.
there is only one issue left, how can you keep the model in its position while you change its parent’s position?
because model already changed its position because of the root animation.
You move the model by the inverse of the amount you moved the parent, effectively moving back to where it was.
Nope I didn’t mean that. How can you transfer its position without a disturbing blinking?
This would just come down do calling the last animation event and doing the math at the perfect time, and transitioning to the next animation with zero transition time and zero exit time in the animator.
thanks, it gave me a good idea but I wish there were a natural solution for it by Unity like a working “Additive reference position” option.
Just curious, is there any reason you can’t enable root motion temporarily to move the player?
heh heh that is also another good approach. Thanks a lot “Temporary enabling of the root motion is the answer of my question”