- Home /
¿How to use animation for same object at different positions?
I have created an animation that moves a GameObject from position X 0 to position 100.
I want to use this animation again to move from 100 to 200 , and for 200 to 300.
I have to create an animation clip to every movement? Or can I use this animation to start relatively to current position?
Answer by unity_GoUPPA2hUMGrPA · Mar 09, 2020 at 10:10 AM
Ok I found the way. For achieve this behaviour you must go to the gameobject that contains the animator component. In the inspector, at the animator part you have to check the checkbox "apply root motion".
Answer by Knights_user · Mar 09, 2020 at 10:42 AM
Another work around is
Parent the object (which you want to animate) under an empty gameObject.
Create animation on child object "that moves a GameObject from position X 0 to position 100".
Now if you "want to use this animation again to move from 100 to 200" , set the parent Object X position to 100.
And if you "want to use this animation again to move from 200 to 300" , set the parent Object X position to 200.
Yeah this way could be useful in some contexts. Thank you