...
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Setup - Unity SDK
Open your Unity project and in the scene Hierarchy window select (World > Example Assets > Props > Workbench > Workbench_LOD0 > Bench Top)
Under the Mesh Collider component turn “Is Trigger Trigger” to off
Scroll down to the bottom of the Inspector window and select (Add Component > (Type in “Rigidbody”) > Rigidbody)
In the Rigidbody component toggle Use Gravity “Use Gravity” to off and toggle Is Kinematic
Toggle “Is Kinematic” to on
Then in the Hierarchy window select (World > Example Assets > Props > Workbench > Stud > Stud)
In the Rigidbody component toggle Use Gravity “Use Gravity” to off and toggle Is Kinematic to on. After that set
Toggle “Is Kinematic” to on
Set your Collision Detection to Discrete
In the Mesh Collider component, toggle Is Trigger “Is Trigger” to off
Right-click on Stud in the Hierarchy window and select (Motive > Make Grabbable)
Scroll down to the new Mesh Collider component and delete it by selecting the *Three dots* on the top right of the component, then select Remove Component
In the new VR Grabbale component, make sure that Allow “Allow Distance Grab Grab” is toggled off
In the Snap Position and Snap Orientation dropdown menus, make sure both values are set to Never“Never”
Toggle Track Orientation “Track Orientation” to off
Set Release Behaviour “Release Behaviour” to Leave “Leave In PlacePlace”
Then change Move Mode “Move Mode” to Physics“Physics”
While you are still in the Stud Inspector window scroll down to the bottom and select (Add Component > (Type in “String State Setter”) > String State Setter)
In the State textbox type “Plank Position”Plank Position
Back in the Hierarchy window right-click on Stud “Stud” and select (Motive > Joints > Add Sliding Joint)
In the new Sliding Joint component under Axis change the X value “X value” to 0 and set the Y value “Y value” to 1
Under Secondary Axis set the X value “X value” to 1 and the Y value “Y value” to 0
Next, select the *Target* icon for the Connected Rigidbody area and then select Bench Top “Bench Top”
Then, toggle Limit Motion “Limit Motion” to On
In the Lower “Lower Limit text area type type” as “-0.2” and for the Upper “Upper Limit type type” as “0.4”
Expand the Upper Stop “Upper Stop” dropdown menu and under “Under Limit Threshold Threshold” type “0.2”
Next in the In “In Limit() area area” hit the + icon then drag Stud “Stud” from your Hierarchy window into the box that reads None “None (Object)”
Then, expand the No Function “No Function” dropdown menu and select (StringStateSetter > SetState (String))
In the *Newly Created Textbox* type “Outside” Outside
Expand the Lower Stop “Lower Stop” dropdown menu and under “under Limit Threshold type type” to “0.1”
Next in the In “In Limit() area area” hit the + icon then drag Stud “Stud” from your Hierarchy window into the box that reads “None (Object)”
Then, expand the No Function “No Function” dropdown menu and select (StringStateSetter > SetState (String))
In the *Newly Created Textbox* type “Inside” Inside
Save the sceneScene
Setup - Storyflow
Open Storyflow and select the Catalogs tab
Select the *Three Bullet List* icon on the right side of the screen (Reference Image Below)
Next, select New Enum Name and type “Plank Position”
After that, hit the > left of where it reads Plank Position and then select New Enum Item Name then type “Inside”
Do this a second time but type “Outside”
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 Anchor > (Type in “Stud”) > Save)
Save the catalog
If you do not have a “Behaviour Model” catalog already, select (Create > Select Type > Behaviour Model > (Type a name) > Create)
Open your “Behaviour Mode“ catalog then select (+ > Behaviour Model > (Type in “Stud Behaviour Model”))
Then select (States + > (Type in “Plank Position”))
Expand the Primitive dropdown menu and change it to Enum
After that, expand the NOT SET dropdown menu and select Plank Position
Save the catalog
Open the Scenarios tab and select (+ Add a New Script > (Type a name) >
Checkmark > (Newly Created Script))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)
In the same grey area mentioned before put the “Behaviour Model” resource there
Select (Targets + > Stud)
Then, select (Behaviour Model > (Your Behaviour Model catalog) > Stud Behaviour Model)
Select the + sign 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
“Set Object State” resource thereSelect (World Objects + > Stud)
Then, select (Behaviour Model > (Your Behaviour Model catalog) > Stud Behaviour Model)
Select (CHOOSE STATE > Plank Position > Compare +)
In the new Value dropdown list select Outside
Next, select the blue + icon on the bottom right of the Set Object State resource, scroll down the list that appears and select Close
In the newly created frame add the “Notification” resource and under Message type “Outside”
Again, select the + sign 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
“Set Object State” resource thereSelect (World Objects + > Stud)
Then, select (Behaviour Model > (Your Behaviour Model catalog) > Stud Behaviour Model)
Select (CHOOSE STATE > Plank Position > Compare +)
In the new Value dropdown list select Inside
Next, select the blue + icon on the bottom right of the Set Object State resource, scroll down the list that appears and select Close
In the newly created frame add the “Notification” resource and under Message type “Inside”
Select Save on the top left of the screen
Next, select the Project tab on the top of your screen then go (Create > Script + >
[Project name] Scripts > (Your new script) > Title > (Type a new scenario title) >
Save)
...