FMP

Totem Down and Some New Movement

By February 17, 2019 No Comments

This past week, I converted another puzzle to work in Virtual Reality. I also added some more movement types to help us decide which works best.

Totem Down

So, when i created this puzzle it had a lot of moving parts. Putting it into virtual reality makes a bit easier from a code perspective. To make the rocks interactable and movable, I added a couple of things to them.

The first was a Interactable component and the second was a Throwable component, both from the SteamVR package.

I also changed some of my code. Before, the puzzle was played by having the player pickup a rock and then placed using a raycast.

Now, the rocks can be moved around as the player wants. Which means I need to allow the rocks to be removed from the totem. The way I did this, was to use the OnCollisionStay() and OnCollisionExit() functions within Unity.

New Movement

Another thing I did this week, was create additional movement types.

I firstly added in the option to chose how you rotate the view. This being either via snap rotation or smooth rotation. Both of these options uses the joystick on an Oculus Touch or the touch pad on the HTC Vive.

The second, was to add in the artificial locomotion to the game. This movement would change the position of the player based on input from a joystick. I added this movement so that I could try it out for myself.

The third, was to add in the teleportation method available within the SteamVR package. To make it work I duplicated the floor plane, and added the teleportation area scrip to it.

 

Finally, I created a menu for selecting the movement type using the SteamVR button prefab. This menu can be shown by pressing the ‘Y’ button on the Oculus Touch controller, but the binding for the Vive is yet to be set.

You can see the result of both the new movement and updated puzzle in the video below

Ethan Bruins

Ethan Bruins

I'm a 3rd Year Student at Solent University, studying a BSc in Computer Games (Software Development) with Industry Placement. On my Placement Year, I worked at Unity as a Technical Evangelist. I traveled the globe attending industry events to talk about Unity.

Leave a Reply