Unity Project 5: Opening Doors (Code Explained)

This script opens and closes the door panel by setting the boolean value in the animator panel to true or false depending on whether the conditions fit whether the door needs to be open or closed. If the conditions for either are met, either the open or closed animation for the door is played in the game.

DoorOpenClosed script

This script works based on whether the player has collided with the door or not. If the player has the door open animation is triggered, if they have not the door continues to be closed or the door close animation is triggered by setting the boolean value to either true or false.


DoorOpenForPlayer script

Comments

Popular posts from this blog

Unity Project 4: Ball platformer game

[Research] Traditional Poster Design (4CTA1214)