Unity/C# Challenge 52: The Elevator Problem Pt 4.

Alec Oney
Nov 23, 2021

Challenge: Implement our elevator movement upwards.

Currently, when we call the elevator, it moves from it’s top location to it’s bottom location. Now, we want it to move back up. We will start to implement this by first changing the box collider for our elevator panel to include the elevator:

When it gets to the target position

The first thing we will do is modify our elevator panel script:

adding a bool for _elevatorCalled

This will change the color of our light depending on if the elevator is going up or down. Then we will update our elevator script:

Now, instead of only going down when we press e, the bool will switch, with one state going up, and the other down:

--

--