Improving the elevator in Unity

Daniel Kirwan
2 min readJul 28, 2021

Objective: Improve the functionality of the elevator system I made in a previous article

This article is about making the elevator from the previous article work a little better and give more feedback to the player that it is working.

I added in some audio sources to the elevator that will play when the elevator is going up or down. I made these myself using Audacity, using just a microphone. I also changed how the lighting on the elevator panel works. I have changed this to change to green for 2 seconds before changing back to red.

The first line will toggle the bool from true to false and false to true everytime the method is called. Then depending on the bool it will play the correct sound.

Then in the Elevator panel script I removed the lines for adjusting the material on the light inside the trigger and moved it to an iEnumerator.

I set the colour to green as I know that the button has been pressed, I then wait for 2 seconds and then turn the colour back to red. This will work for both elevator panels that are associated with the same elevator object.

And that is it for improving my elevator system. This way the player gets feedback from two angles, one is the light changing colour and the other is a voice over that will play.