Skip to main content

Steam VR setup Tutorial #3 - Interactable object setup

Aims

The aim of this tutorial is to get you started creating objects that you can interact with using your HTC VIVE controllers (Using Steam VR 2.2 plugin).

Please notice that this is part of a series of tutorials progressing from basic concepts to more functional and complex proyects. In previous pages we already explored how to setup the scene you are expected to use for this tutorial.

Prerequisites

  1. Setting up the Steam VR plugin.
    Steam VR setup tutorial# 1

  2. Setting up teleporting feature (Optional).
    Steam VR setup tutorial# 2

Getting started

In Steam VR setup tutorial #2 we added a blue material to a plane in order to make it easier for us to see the teleporting feature at work. In this tutorial you are going to learn how to create two "throwable" objects but first we are going to create a plinth to put the throwable objectS on so it is easier to test them.

To begin, right-click over the Hierarchy panel and select cube.

Unity-SteamVR-Setup-29.png

You should now see a cube intersecting the walking plane.

Unity-SteamVR-Setup-32.PNG

Now let's change the scale and the position to make it look like an actual plinth. With the cube selected look at the Transform component parameters shown on the Inspector, you will see that by default, your cube has the scale set to "1" and both Position and Rotation parameters should be set to "0" an all three axis.

Unity-SteamVR-Setup-31.PNG

Let's increase the "Y position" value up to 0.75 and the "Y scale" value to 1.5. It is also important to give meaningful names to our objects to keep our scene tidy. In order to change the name of a selected object just left-click inside the text field located on top of the Transform component and type your text.

Unity-SteamVR-Setup-35.png

Unity-SteamVR-Setup-30.PNG

Now our plinth should be taller and placed at the right height.

Unity-SteamVR-Setup-33.PNG

Now we needare going to create our interactable objects. FirstTo create the first one, right click over the hierarchy panel and select cube. With our new cube selected, lets change the Transform parameters to make it sit on top of our plinth. First change the scale down to 0.2 on all three axis then change the Position values as follows: x=.2, y=1.6 and z=0. Finally, let's put a name to it in order to keep things tidy, you can call it whatever you want, we suggest a meaningful name like "Magic cube".

Unity-SteamVR-Setup-34.PNG

We should see our "Magic cube" on top of our "Plinth".

Unity-SteamVR-Setup-36.PNG