A complete VR Game

Using Unity VR

This VR Game isn't really a game, rather it's a collection of all the things I have learned to do in VR. The three videos below are described in detail with the following three paragraphs. Not shown but running in the background is the use of Unity's new (at the time) action based system that accepts VR input from multiple headset devices and also covers movement. Also not shown is a smart hand presence that reads your device and changes to show your specific device controllers. There are other minor things not necessarily related to VR mechanics but that I enjoyed learning and adding to this not game game. They include camera mirrors, reflection probes, lerp resetting pixel targets, and cloth physics.

In the first video the player can use either direct interaction grab or ray interaction grab (force pull) to pick up the balls and put them in the drawer. The drawer can be opened and closed by interacting with the handle and comes out to a limit point using a configurable joint. The door works similarly except it uses a hinge to limit how far it opens. Grabbing the orange ball showcases an offset grab that is kind of like using the force. Essentially you can pick up a ball from a distance and the ball will keep “levitating” in place. We move on to see a ray interaction that previews the next box color the box will turn once the lever is pulled. The lever works with a hinge. Pulling it down will change the box's color to the next and pulling up will change it back to the previous color. The video follows with a quick show of how teleportation works on teleportable surfaces (purple floor) with a visual blue particle system effect preview to show you where you will be teleported to (push forward on stick while holding trigger then release or press button 1 to teleport). A bowling mini game on a frictionless surface and two handed climbing using XR Base Interactable tweeted a bit for our purposes. Finally a lever to pull at the top of the climbing wall is used to teleport you on top of the tower.

The second video shows off the three available inventory pockets available to players. These work using snap zones. We start with the two approximately at waist level which will change height depending on the player's real world height while standing or crouching. They will also stay at waist height when climbing. The third is an upper back snap zone that is located roughly behind your head. All these snap zones use the XR Socket Interactor. With the assault rifle we can see the use of two handed grab which inherits from XR Grab Interactable with a couple overrides. The trigger hand on the rifle can independently affect the pitch, roll, and yaw of the gun. When both the trigger and the guard areas are being held with both hands they collectively affect the pitch and yaw but only the trigger hand can affect the roll. Both the cans and target use a Lerp Reset script with the target cubes frozen on the X and Y axis. Guns shoot a sphere projectile and have sound effects. The light saber can be seen being turned on and off. It includes sound effects for that and for when it is swished around with enough force.

The third video starts off by showing interactions with simple UI elements (drop down box, slider, and button) using ray interaction. A point is made to show that teleportation does not work through walls. The hat wall is made of XR Socket Interactors that can each hold any type of grabable inventory. There is also a socket on top of your head that can only hold hats. Your pockets can only hold weapons, not hats or balls. For the three panel mirrors the two mirrors on the sides use cameras that change in height with your head and project what they see onto the mirror. The mirror in the middle uses a single reflection probe. At the end of the video is a show of cloth using cloth physics. It can be seen interacting with the light saber and itself.