In this recipe, we will learn how to animate an object's local position to be able to use the same animated object in multiple locations in the scene. We will create another common gameplay mechanism, automatic door, as an example.
Animating object's local position - creating automatic doors
Getting ready
To make an animated door, you should have two objects ready: the Door Frame and the Door. The Door should be a child of the Frame in the Hierarchy. It should be placed in the closed position. We assume that our Door will slide upward when opening. You should also have a player character with the Player tag assigned. The character should use a Rigidbody component to move or have...