Touch Resource - SDK Object Configuration

 

In depth learning on Usable World Objects can be found in this course in Motive Academy.

Overview

This article describes how to configure an object to respond to the Touch Resource in a Storyflow Script.

The object can be configured in two different ways.

  1. With no Rigidbody and a Convex Mesh Collider where IsTrigger = true

  2. With a Rigidbody and a Convex Mesh Collider where IsTrigger = false

This outlines how to create a Storyflow Script and test both configurations.

This video demonstrates the steps outlined in this article

Only use one configuration. Decide which is best for your use case and choose that one.

Unity Configuration #1

Use this configuration when you want the user to touch the object but the object should not use physics.

  1. In the Hierarchy, find the Paint 5G Bucket

  2. Right click on the object and select Motive > Make Scene Object

  3. Give the Scene Object a name (in this example: Paint 5G Bucket)

  4. Add a Mesh Collider

  5. Set the Mesh Collider to have Convex = true and IsTrigger = true

Unity Configuration #2

  1. In the Hierarchy, find the Paint 5G Bucket

  2. Right click on the object and select Motive > Make Scene Object

  3. Give the Scene Object a name (in this example: Paint 5G Bucket)

  4. Add a Mesh Collider

  5. Set the Mesh Collider to have Convex = true and IsTrigger = false

  6. Add a Rigidbody

Storyflow Catalog Setup

  1. In Storyflow, go to the Catalogs tab

  2. Add “Paint 5G Bucket” to a Named Object Catalog (If one does not exist, create one)

  3. Save the Catalog

Storyflow - Create a Test Script

  1. Go to the Scenarios tab

  2. Create a Script called Test Touch Resource

  3. Save and open the new Script

  4. Add a Scene Object Resource to the Frame

  5. Select “Paint 5G Bucket” from the Named Object Catalog

  6. Add another Frame

  7. Add a Touch Resource to the Frame

  8. Select “Paint 5G Bucket” from the World Objects menu

  9. Click the Event Link Shortcut (blue + button at the bottom of the Touch Resource) and select “complete”

  10. In the newly created child Frame, add a Notification Resource (Playable Content type)

  11. Enter some text into the Message field

    1. Optional: Add an image or a sound

  12. Save the Script

  13. Click the Project tab

  14. Link the “Test Touch Resource” Script to a Scenario

  15. Save

Unity - Run the Scenario

  1. In Unity, play the Scene

  2. Run the Scenario and touch the Paint 5G Bucket

The notification will appear.

Related Articles

Unity Components