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.
With no Rigidbody and a Convex Mesh Collider where IsTrigger = true
With a Rigidbody and a Convex Mesh Collider where IsTrigger = false
This outlines how to create a Storyflow Script and test both configurations.
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.
In the Hierarchy, find the Paint 5G Bucket
Right click on the object and select Motive > Make Scene Object
Give the Scene Object a name (in this example: Paint 5G Bucket)
Add a Mesh Collider
Set the Mesh Collider to have Convex = true and IsTrigger = true
Unity Configuration #2
In the Hierarchy, find the Paint 5G Bucket
Right click on the object and select Motive > Make Scene Object
Give the Scene Object a name (in this example: Paint 5G Bucket)
Add a Mesh Collider
Set the Mesh Collider to have Convex = true and IsTrigger = false
Add a Rigidbody
Storyflow Catalog Setup
In Storyflow, go to the Catalogs tab
Add “Paint 5G Bucket” to a Named Object Catalog (If one does not exist, create one)
Save the Catalog
Storyflow - Create a Test Script
Go to the Scenarios tab
Create a Script called Test Touch Resource
Save and open the new Script
Add a Scene Object Resource to the Frame
Select “Paint 5G Bucket” from the Named Object Catalog
Add another Frame
Add a Touch Resource to the Frame
Select “Paint 5G Bucket” from the World Objects menu
Click the Event Link Shortcut (blue + button at the bottom of the Touch Resource) and select “complete”
In the newly created child Frame, add a Notification Resource (Playable Content type)
Enter some text into the Message field
Optional: Add an image or a sound
Save the Script
Click the Project tab
Save
Unity - Run the Scenario
In Unity, play the Scene
Run the Scenario and touch the Paint 5G Bucket
The notification will appear.
Related Articles