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! :stuck_out_tongue:

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? :slight_smile:

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.