Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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

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

Make a Unity Object VR Grabbable.mp4

Step 1: Unity SDK - VR Grabbable

  1. In the Hierarchy, find the object you wish to make grabbable. We use the “brush” in this case. It can be any object

  2. Right click on the object

  3. Select Motive -> Make Grabbable

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

    1. A Rigidbody

    2. A Mesh Collider

    3. VR Grabbable script

  5. Make the Mesh Collider = Convex

  6. Save the Scene

  7. Play the Scene

  8. 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

    2. 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

  2. Select Motive -> Make Scene Object

  3. In the name field, type a name

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

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

  4. Save the 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 Catalog

    1. If one does not exist, create one

  2. Add an item to the Catalog

  3. 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

  4. Save the Catalog

Step 4: Storyflow - Create a Test Script

  1. Go to the Scenarios tab

  2. Create a new Script called Test Grasp - VR Grabbable

  3. Open the Script to edit

  4. Add a Scene Object Resource

  5. Click the + icon on the Object field

  6. Select the object you added to the Catalog

    1. The example used the name Brush

  7. Add a Frame

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

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

  10. In the newly created Frame, drag and drop in a Notification Resource (Playable Content)

  11. Enter some text in the Message field

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

  12. Save the Script. When this Script is run in the VR Scene, it will wait until the object (Brush) is picked up

    1. When it is, the Notification will display

  13. Click the Project tab

  14. Assign the Test Grasp - VR Grabbable Script to a Scenario. If no Scenario exists, create one

  15. Save the Scenario

Step 5: Unity - Run the Test Script

  1. In Unity, play the Scene and select the Scenario

  2. Pick up the object (Brush).

    1. Notice that the 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 and triggered a Notification after the appropriate action was taken.

Related Articles

Resources: An Overview

Events: an Overview

  • No labels