Skip to main content
Skip table of contents

Grab

Grab nodes, as the name implies, requires a user to grab an object to progress. This could be grabbing a tool, a walkie talkie or even a fire extinguisher. Find an example of this already set up for you in Assets > open-xr-template-core > Prefabs > Preset Objects

Grab Step being used to grab a tool

Setup

Grab Node

Follow these steps to set up a new grabbable object that will progress the user in the graph when grabbed at the required step.

Scene Setup:

  1. Start with a GameObject you'd like to be able to grab. This could be a cube for example.

  2. Attach a “Guid Component” script.

  3. Attach a “Collider” Component.

  4. Attach a “Rigidbody” Component.

  5. Attach the “Grabbable Open XR” script.

  6. Attach the “Grabbable Middleman” script.

Graph Setup:

  1. Open your graph. (In your module hierarchy go to Managers > Game Manager, In the inspector find the component called “Graph Flow Manager” and double click the Node Graph.

  2. Right click and Create a new grab node (Steps → Grab).

  3. Reference the grabbable middleman on the step.

The components needed on a GameObject for a Grab to work

That's it. Now when a user is on the Grab step, when they grab the newly made object they will complete the step.

Attach Transform

In the provided Grabbable Sample Prefab you will notice a child GameObject called Attach Point, this will be where a user will precisely hold the object once grabbed. For example if you wanted to set up a baseball bat you would move this transform to be in line with the bats handle.

The Attach Point GameObject


For more information on the other inputs and outputs found on this node see Steps

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.