Make Attachable / Using Attachable Receivers
In depth learning on Attachables is found in this course in Motive Academy.
Overview
This article describes how you can implement Motive’s premade Attachable components in order to make two objects interact with one another in a VR scene. One object will be able to be grabbed and then subsequently placed on the receiver object. This tutorial will also include information on how to use this functionality in combination with Storyflow.
Important: Any object that will be used as part of a training procedure authored in Storyflow must be a Motive Scene Object.
Setup - Unity SDK
Open your Unity project and in the scene Hierarchy window find “Hammer” World > Example Assets > Props > Workbench > Hammer
Right-click on the Hammer then select Motive > Make Attachable
In the Hammer Inspector window scroll down until you find the VR Attachable component
Scroll to the bottom of the component and expand the Attaches To dropdown list
Increase the Size to 1
Element 0 will appear, and from there you need to expand it and under Type write “Test”
In the scene Hierarchy window find “Stud” World > Example Assets > Props > Workbench > Stud > Stud
Right-click on the Stud then select Motive > Make Attach Receiver
In the Stud Inspector window scroll down until you find the VR Attachable Receiver component
Scroll to the bottom of the component and expand the Receivers dropdown list
Increase the Size to 1
Element 0 will appear, and from there you need to expand it and under Type write “Test”
Change Max Attachments to 1
A bit higher in the component toggle Attach to Surface to on
Save the Scene
Setup - Storyflow
Open Storyflow and select the Catalogs tab
If you do not have a “named Object” Catalog already, select Create > Select Type > Named Object > (Type a name) > Create
Open your “Named Object “ Catalog then select + > Named Object > (Type in “Stud”) > Save
Do this twice but for the second object write “Hammer”
Save the Catalog
Open the Scenarios tab and Create a New Script, then open it
Under Resources on the right side of the screen click and drag the Scene Object Resource into
the grey area in the center of the screenSelect Object + > (Your Named Object catalog) > Stud > Save
Do this twice but for the second object select Hammer
Select the + icon attached to the “Main Frame” on the left side of the screen
Select the newly created frame and in the same grey area mentioned before put the
Place Resource therePlace can be typed into the Resource search bar for easy access
Select the drop-down menu under World Objects and select Hammer
Select the drop-down menu under Targets and select Stud
Select the drop-down menu under Event and select Complete then select the + icon right of the drop-down menu
In the newly created frame and in the same grey area mentioned before put the
Notification Resource thereUnder Message type Great work
Select Save on the top left of the screen
Create a Scenario if you don’t have one already
Link the Script you created to the Scenario
You can now open your Unity Project select the newly created Scenario, grab the hammer from the backside of the workbench and place it onto the wooden stud on top of the workbench!
(If you can’t reach the Hammer remember you can teleport by pressing forward on your remote joysticks)
Related Articles