S&box Wiki

Revision Difference

GettingStartedWithVR#560202

<cat>Code.VR</cat> <title>Getting Started</title><title>Getting Started</title>⤶ ⤶ # Basic Player Setup⤶ ⤶ ## Tracking⤶ ⤶ First things first, create an empty gameobject to be your player, and add the **VR Anchor component**. This will represent the center of your play space.⤶ ⤶ <upload src="b4aa4/8dc1911f2b4650f.png" size="14409" name="image.png" />⤶ ⤶ Now for a head and hands, create **Head**, **Left Hand**, and **Right Hand** gameobjects, then add a **VR Tracked Object** component to each, setting the **Pose Source** property to the matching controller or headset.⤶ ⤶ <upload src="b4aa4/8dc19127bd27a63.png" size="18858" name="image.png" />⤶ ⤶ ## Visuals⤶ ⤶ So you're done! except, you can't see anything, So lets add some visuals. If you don't have a camera in the scene, create one, then parent it to the **Head** gameobject so it follows your head movements. Now for each hand, grab a hand model and parent it to the corresponding hand object, and add the **VR Hand** component with the correct hand set in the **Hand Source** property. This should add finger tracking to the hand models, if they are rigged correctly.⤶ ⤶ <upload src="b4aa4/8dc19130a2e6863.png" size="32818" name="image.png" />⤶ ⤶ After all that, you should have a basic VR player, and your setup should look something like this.⤶ ⤶ <upload src="b4aa4/8dc191323cbf00d.png" size="2811" name="image.png" />