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 Flow-SDK → Ready to Use Prefabs → Grabbable Sample

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 - This is where the user will be able to grab the object.

  4. Attach a “Rigidbody” Component.

  5. Attach the “Grabbable Open XR” script.

  6. Attach the “Grabbable Middleman” script.

Graph Setup:

  1. Open your 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

Desktop

Desktop doesn’t have a controller for the attached object to go to and instead uses an offset. You can change how this offset is aligned by going to the “Grabbable Desktop” component and changing the offset/rotation settings. This will only have an effect on Windows PC builds.

image-20240619-123605.png

Multiuser

If you wish to use multiuser we would suggest having a NetworkGrabManagerOpenXR Component attached to the object, as well as the usual PhotonView/PhotonTransformView. This ensures players can ‘Takeover’ control of the object when they grab.

image-20240620-083038.png

Network Grab Manager


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.