Script Your first VR Scenario
The Motive training platform allows learning designers and content experts to control a 3D scene built in Unity with a drag and drop, codeless authoring tool. The scripts that you create in the editor are delivered directly to the app at run-time meaning that the app can be deployed directly to a VR headset, like an Oculus Go.
Ready to give it a try?
Part 1: Add some ambience
In the script editor, you’ll see a script called “Authoring Demo”. It already has two frames. The main frame generally has no content in it, the next frame “Scene Objects” contain the 3D objects we want to be able to control and interact with in the scene. We need to place these in the script to make them interactable.
Add a New Frame
Name it “Ambience”
Add an Object Playable Resource to the Frame
First, add an “Object Playable” by dragging it into the middle or double-clicking on it. We’re going to use the Object Playable to send a video to the main TV screen in the scene.
Select “Table Head Screen” as the target object for the video.
In the “content” field select “Screen Media”. More fields will open to allow you to select the screen media (in this case a video) that you want to use.
Choose “Add from Catalog”. Select the “Starship Videos” catalog and select the video you would like to play on the main screen. “Space Travel” would be a good choice.
Expand “Playback Properties” and select “Loop” so that the video plays continuously.
Add a Playable Content Resource to Frame
Now Let’s add some background sound. Scroll down to find the “Playable Content” resource and drag it into the frame. You can also click on the Playable Audio resource to expand it and drag “Audio” in directly. This saves you a configuration step.
Select the sound you’d like to play from the “Starship Audio” catalog. Check the “loop” box to make sure the sound is continuous.
Part 2: Create a Crisis
Add another new frame. Name it “Crisis”
Add a precondition
In the “Add Condition” selection field choose “Timer”.
In the “Delay” field, enter 3 seconds. This will ensure the crisis begins three seconds after the scenario starts.
Add a Script Launcher
Drag a “Launch New Script” resource into the frame
Select the script “Main Alert” from the catalog.
Add An Object Playable to Change the Main Screen Video
Drag an Object Playable into the frame. Follow the steps you took previously to target the main screen in the scene and change the video
Select “Table Head Screen” as the target object for the video. In the “content” field select “Screen Media”. More fields will open to allow you to select the screen media (in this case a video) that you want to use.
Choose “Add from Catalog”. Select the “Starship Videos” catalog and select the video you would like to play on the main screen.
Expand “Playback Properties” and select “Loop” so that the video plays continuously
Part 3: Create a Dilemma
Create a new Frame with a Condition
On the “Main Alert” script launcher resource, click the teal triangle on the bottom right corner of resource. This allows us to choose a condition under which the next frame will be launched.
From the list pick “close”. A new subframe will be created. It has the precondition “When the Main Alert script closes, start this frame”
Make the Officers Speak
Add an “Object Playable” resource to the frame
We’re going to target the officer on the left and have him suggest one course of action. From Objects select “Officer Left”. Choose the content type “Character Message”. In the text field type “Send a greeting party”.
Create a new frame when this interaction is complete by using the script-launcher shortcut (the teal triangle) like you did previously. Click the “+” and select “Close” from the menu. A new subframe is created.
In this new frame, drag another “Object Playable” resource. This time, target the “Officer Right”. Choose a content type of “Character message” and type “Attack at once”.
Part 4: Give the User a Choice
Create a New “Choice” Subframe
Use the frame-launcher shortcut again to have a new frame open on the “close” of the last frame.
Name this frame “Choice”.
Create An Inquiry
Drag an “Inquiry” resource into the frame. An inquiry resource is used to present the user with options.
Add a choice by clicking on the “+” beside “Choices” in the resource. For the first choice select, “Officer Left” as the object, select a “text media prompt” and add the text “Send a greeting party”.
Add a second choice by click the “+” beside “Choices” again and this time, choose “Officer Right” as the object, select a “text media prompt” and add the text “Fire torpedoes!”
Create a Branching Scenario
Next, creating a branching narrative, based on these two choices. We’ll create the branch for the case where the user decides to take the advice of the hostile officer. Click the “+” at the bottom of the “Fire Torpedoes” choice. A new frame has been created that will only open if the player selects that option.
Create an outcome for Choosing Option 2
In reaction to the advice “Fire Torpedoes” we’ll push a video of an explosion to the main screen. In the frame that has been created, drag and “Object Playable” in. Target the “Main Screen” object and select “Screen Media” as the content type. Choose an “Explosion” video from the catalog.
Challenge – can you add an outcome that occurs if you decide to take the advice of the left-hand officer?
Here is a video run-through of the entire scripting process: