Puzzles Pt2
Picking up where I left off with creating a puzzle I will now be showing how to move the elevator down. We know that the elevator must move between 2 points just like our moving platform script. We also know we will need the position for each of those 2 endpoints. So the first thing is to create a script that has to locations for where to start and end, how fast to move, and is the elevator going down. If the elevator is going down run a command for movement
We will also have to communicate with the elevator panel script to call the elevator down via elevator panel button.
Now the elevator will come down when the E key is pressed and all 8 coins collected.
Now the elevator must go up to the next level if we want to be able to continue on with the puzzle. We must now tell the elevator when it is at the bottom level it will now return to the original point. When the player enters onto the platform and the press the E button to trigger the elevator to go back up the color of the button changes back to red. We must also add a 2nd collider to the elevator that is set to a trigger. Also when you hop on the elevator platform the player will now become attached the elevator as a child and when he hops off he will no longer be a child.
Next time we will be finding out how to navigate the next level by wall jumping.