Below is a screenshot of what the 'handles' will look like before the puzzle is completed. They will be this glowing red. Once they have been rotated to the right angle they turn green.
Below is a screenshot of all the handles in the right rotation for the puzzle to be complete. As you can see they are all green now.
Below is the On Mouse Rotate script for the puzzle. This is where the material changes colour from red to green when the objects are in their right position - I have higlighted what we added yesterday in purple. We have also scripted the objects to play a sound when they are in the right position so that the player not only has a visual representation of the object being in the right place, but an audio representation as well.
Below is the Puzzle Complete script. Michael pointed out that if the player were to complete the puzzle and have all the pieces green the door would open, however if they then rotate an object after the puzzle has been completed the door would stay open and not close again. So I added the line of code in purple to make sure that the door would close again if all the pieces were not right.
Both Michael and I are extremely happy with the result.
No comments:
Post a Comment