1
\$\begingroup\$

I am making a 2D game in Unity and I want to create an animation that works with any object and takes that object's position into account.

The animation should be a little bounce, basically move it up from its current position and then move it back down to that same position. The problem is when I create that animation and then move the object after, and later play that animation, it goes back to the keyframed location instead of bouncing in-place.

What is the correct way to achieve the goal that I'm describing?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You have to make Empty GameObject and make your GameObject parent of this. After that you don't have to add animation component to Empty GameObject; you have to add Animation component to your GameObject and test again, but don't move Empty GameObject: you have to move your main GameObject.

Look at this video, not mine: How To Fix Unity Animation Position Issues

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .