- Home /
Opening multiple doors with the same animation
Hey!
I have a question which I can see is a fairly common problem for us new people! :P
However, I couldnt find answers for my specific problem.
I made a door, and I have opened it and all. I use a raycast from the player, and I made an animation inside Unity that just decreases the y-value to make the door decent and allow you to pass.. When I make a new door with the same animation however, the problem arises - The new door will teleport to the originals doors position and play the animation from there.. How to fix? :)
Answer by syclamoth · Oct 07, 2011 at 11:11 AM
This is a common problem, and, as could be expected, has a common solution!
Animations of this kind are evaluated from local coordinates. If you wanted to have several doors, you would make the actual door a child object of 'doorcontroller' object, and then move the doorcontroller around instead! This way, you can move the door around without worrying about it teleporting back to its original position, because the door itself won't know that it has moved.
Your answer
![](https://koobas.hobune.stream/wayback/20220613000823im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Begginers question, Simplifing a script, opening two doors with 2 overlapping triggers. 1 Answer
Is it possible to import a Flash animation to be my game's splashscreen? 1 Answer
multiplying door problem!! 2 Answers
Changing my character's running/walking/crouching/idle animations 1 Answer
Starship Doors / Hatches 2 Answers