Week 9: VR Escape Room Implementation
We started this week by creating the fire and the fireplace. At first, we tried to search for an asset bundle that has both, but we ended up only finding separate ones for each of the fire and the fireplace. So we first downloaded the fireplace asset and added it to the corner of the room. Then we found a cool campfire asset that we can add to the fireplace. This asset gives a really nice fire effect (lights, sparks, sounds, smoke,...) so that helped us at this point.
We need the fire to be on when the game starts, and then the player should turn it off to find the key to the outer door. So we created a script for the fire, that makes it turn off as soon as the bucket collides with it. Which means that the water turned it off.
In the following snippet, you can see that if the bucket collider triggers the fire’s collider, and the bucket is full of water, the fire will turn off.
So we added to the fire script, the logic that would make the key appear. So we extended the last snippet to be:
And we also added the grabbable script to the key so that the player can grab it.
Next step is to find a suitable puzzle for the scene, and a controller with many buttons, and only one button represents the correct answer, so that the player has to hit that button to turn on the water tap.
So we added a plane and we put it on the table next to where we will add the buttons controller. We created a new material with a shader of type “Legacy Shaders/Diffuse”, and we added the image of the puzzle as the texture of the material, as the following figure shows:
We found a controller box with buttons that we can add to the scene and next week will make the logic of pressing the buttons.
Comments
Post a Comment