0% found this document useful (0 votes)
7 views10 pages

VR Grabbable Objects - classDemoPPT

The document outlines the steps to create grabbable objects in a Unity VR project using the XR Interaction Toolkit. It details the installation of the toolkit, setting up an XR Rig prefab, and adding an XR Grab Interactable component to a cube for interaction. Additionally, it describes how to implement input detection for grabbing and releasing the object with corresponding console messages.

Uploaded by

Vinoth Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views10 pages

VR Grabbable Objects - classDemoPPT

The document outlines the steps to create grabbable objects in a Unity VR project using the XR Interaction Toolkit. It details the installation of the toolkit, setting up an XR Rig prefab, and adding an XR Grab Interactable component to a cube for interaction. Additionally, it describes how to implement input detection for grabbing and releasing the object with corresponding console messages.

Uploaded by

Vinoth Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

VR - Grabbable Objects

First, you have the XR Interaction Toolkit package installed in


your project. You can do this by going to the Package Manager in
Unity and searching for "XR Interaction Toolkit".
VR - Grabbable Objects

Create a new scene in Unity and add the XR Rig


prefab from the XR Interaction Toolkit to your
scene. This prefab includes the necessary
components for VR input, such as the XR Rig
script, the XR Camera Rig script, and the XR
Interaction Manager script.
VR - Grabbable Objects
VR - Grabbable Objects

Add a plane and a cube to your scene.


VR - Grabbable Objects

Add an XR Grab Interactable component to the cube. This will


allow the cube to be grabbed and released using the hand
controller.
VR - Grabbable Objects

Use Unity's Input System to detect when the user presses a


button on their hand controller to grab the object.
VR - Grabbable Objects

When the object is grabbed, the OnGrabbed() method is called


and a "Object grabbed!" message is printed to the console. When
the object is released, the OnReleased() method is called and a
"Object released!" message is printed to the console.
VR - Grabbable Objects
VR - Grabbable Objects
THANKS

You might also like