- Home /
How do I play the same animation in other places in the game world?
Hi, I'm kinda new to Unity and I know this question has been asked a lot of times but I can't seem to make it work. The other answers have been just to create an empty gameobject as a parent to the gameobject with the animation. I'll explain my setup a little to make it easier to understand. Right now I have a box and my player an animation that jumps over that box, when I get near it I can press the Space button, it plays the animation and then I can continue playing. My problem however is that when I duplicate the box somewhere else and I play the animation, it obviously brings me back to where I created the animation in the first place. If I use the box as my player's Parent, when I duplicate it, it also duplicates the player, so I can't do that. Right now I'm out of ideas (maybe I'm just tired :D), so any help is appreciated, sorry for this to be so long, thank you very much.
silly question but how do you play back the animation and did you do the animation in unity or somewhere else ? perhaps the animation keeps track of the location and you could just remove the location from the animation ?
I Play the animation with a trigger collider attached to the box, so when I enter it I can press the space bar to play the animation jumping over it. I made the animation in unity itself, since it's a very basic one.
Answer by Atonez · Sep 24, 2014 at 01:34 AM
I believe that you should try and unparent the box and then duplicate it. If that does not work try and make the player the parent of the box.If these anwsers do not work check the links below out.
http://forum.unity3d.com/threads/playing-animation-local-to-position-in-unity.53832/
http://answers.unity3d.com/questions/356442/using-the-same-animation-on-duplicate-objects.html
If I make the player parent to the box, whenever I move the box will be moving also, so that would make a really weird chasing game :D. If I unparent the box and duplicate it still does the same, thanks for the links, but I already saw them and didn't really help me, I appreciate the effort though. This animation thing is really killing me :S
Your answer
![](https://koobas.hobune.stream/wayback/20220613163559im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Trail of color behind the player 2D c# 1 Answer
Idle Animations, Player Walking 0 Answers
Create Player From Values [ Photon ] 0 Answers
How to move player after animation 2 Answers