Puzzles Pt 1
Ever played those games that make you think how do I get through this level??? I’ve been here for hours trying to figure out how to complete this puzzle. Well I’m not going to be showing how to create anything that complicated, but I will be showing the basic ideas of how puzzle making is done. As you can see the level itself has evolved into a much larger scene.
The first challenge to our player is getting to higher levels. Our player can’t go any higher till the elevator is dropped down.
To be able to change the light of the elevator to green from red run the code below. As the player enters the collider it triggers that the player has entered the space and if the E key is pressed it changes the color.
Now we need to make sure that the player needs to collect all 8 coins on the lowest level to be able to call the elevator. So I will need to be able to communicate with my Player script and create a public method that I can access from the elevator script to see how many coins were captured. I also added a required coins variable to show how many coins were needed to trigger the elevator and made that part of the if statement to trigger the elevator.
Next time we will be looking at all to call the elevator down to the player. Stay tuned for part 2!