Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
panelIconId1f393
panelIcon:mortar_board:
panelIconText🎓
bgColor#4C9AFF

In depth learning on Scene Configuration can be found in this course in Motive Academy.

Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse

Overview

This article shows how to:

  • Make a Unity object grabbable in VR using the SDK

  • A simple example of using Grab Anchors

  • Make the Unity Object recognizable in a Storyflow script using a Motive Scene Object

  • Add a reference to the object in a Storyflow Catalog

  • Create a test Storyflow script which uses the Object Interaction → Grasp Resource

  • Run the test Storyflow script and verify that the Unity object configuration was done correctly

...

Step 1: Unity SDK - VR Grabbable

  1. In the Hierarchy, find the object you wish to make grabbable. We use the

...

  1. “brush” in this case. It can be any object

...

  1. Right click on the object

...

  1. Select Motive

...

  1. > Make Grabbable

  2. In the Inspector, notice that three components have been added to the object

...

    1. A Rigidbody

    2. A Mesh Collider

    3. VR Grabbable script

  1. Make the Mesh Collider = Convex

...

  1. Save the

...

  1. Scene

  2. Play the Scene

  3. Pick up the brush. Notice that the brush can be picked up from any point. Specific grab points can be defined in the VR Grabbable script

...

    1. Optional: Add a grab anchor to the handle. A grab anchor is a transform. You can use the buttons to define a grab anchor for either hand or you can create your own and assign it

...

    1. Optional: Options for release behavior, distance grabs and more can be configured in the VR Grabbable script component

...

The object is now able to be picked up in VR. You can configure the specific behavior based on your use case.

Step 2: Unity SDK - Motive Scene Object

To be usable with Storyflow, add a Motive Scene Object script and give it a name.

  1. Right click on the object

...

  1. Select Motive

...

  1. > Make Scene Object

...

  1. In the name field, type a name

...

    1. Remember this name. A

...

    1. Catalog item with the same name will need to be created in a Storyflow Catalog

...

    1. For this example, the name will be 'Brush'

...

  1. Save the

...

  1. Scene

At this point, everything that is needed has been configured in Unity

...

Step 3: Storyflow - Named Object Catalog Item

  1. In Storyflow, go to the Catalogs tab and find a Named Object

...

  1. Catalog

    1. If one does not exist, create one

...

  1. Add an item to the

...

  1. Catalog

  2. Select the item and give it the same name that was given to the Motive Scene Object

...

    1. In this case, the name is Brush

...

  1. Save the

...

  1. Catalog

Step 4: Storyflow - Create a Test Script

  1. Go to the Scenarios tab

...

  1. Create a new

...

  1. Script called Test Grasp - VR Grabbable

...

  1. Open the

...

  1. Script to edit

...

  1. Add a Scene Object

...

  1. Resource

  2. Click the

...

  1. +

...

  1. icon on the Object field

...

  1. Select the object you added to the

...

  1. Catalog

    1. The example used the name

...

    1. Brush

  1. Add a

...

  1. Frame

  2. Drag in the Grasp Resource and select the object ('Brush') from the World Object drop down menu

...

  1. Click the Event Link Shortcut (the blue "+" button) and select

...

  1. complete

...

  1. In the newly created

...

  1. Frame, drag and drop in a Notification Resource (Playable Content)

  2. Enter some text in the Message field

...

    1. Optional: Give the Notification a sound or an image if you'd like

...

  1. Save the

...

  1. Script. When this

...

  1. Script is run in the VR

...

  1. Scene, it will wait until the object (Brush) is picked up

...

    1. When it is, the Notification will display

...

  1. Click the Project tab

...

  1. Assign the Test Grasp - VR Grabbable

...

  1. Script to a

...

  1. Scenario. If no

...

  1. Scenario exists, create one

...

  1. Save the

...

  1. Scenario

Step 5: Unity - Run the Test Script

  1. In Unity, play the

...

  1. Scene and select the

...

  1. Scenario

  2. Pick up the object (Brush).

    1. Notice that the

...

    1. Notification shows once it is picked up

...

At this point, the Unity object is configured to be grabbable in VR, made recognizable in Storyflow, used in a script Script and triggered a notification Notification after the appropriate action was taken.

Related Articles

Resources: An Overview

Events: an Overview