Unity Project 5: Opening Doors
Scene view |
Animator panel, where you can create a motion path for the door to open and close.
Animator panel |
Door is open |
Door is closed |
Door frame inspector |
When the player is in close proximity to the door, the door opens.
Door opened |
Door closed, as the player is too far away from the door for it to be open.
Door closed |
Hierarchy |
Parameter 'IsOpen' (Boolean) is unchecked so that the door begins closed as it isn't open otherwise the door would be open.
Parameters |
The 'Loop Time' box needs to be unchecked on the animated asset otherwise the door will continuously open and close. This looping isn't needed as the door open/close animation is triggered by the player's collision with the door frame.
Open animation inspector |
Comments