Script Your First VR Scenario

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

Click the “+” symbol at the end of the main frame to add a new frame.
Create a new frame

Name it “Ambience”

The teal color of this new frame indicates that it is active.

In this active frame, we’ll add two “resources”. Resources are listed on the right hand side of the window – you can drag them into the editing area in the middle to use them.

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.

Select a space video from the catalog

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.

Click “Save”


Put the Oculus GO headset on and restart the app. You should now see a video on the main screen and hear your background sound playing

Part 2: Create a Crisis

Add another new frame. Name it “Crisis”

Add a new frame called crisis

Add a 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.

In this frame, we’re going to add a “Script Launcher”. This will launch another script we previously authored that plays a warning sound and blinks the lights. This showcases the ability to create reusable scripts and collaborate with other content creators.

Add a Script Launcher

Drag a “Launch New Script” resource into the frame

Select the script “Main Alert” from the catalog.

Launch New Script Configured

 

In addition to the “Main Alert” script launcher, we’ll change the video on the main screen.

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

Final settings for the Object Playable. Object: Table Head Screen, Content: Screen Media, Media: Red Alert Video, Playback Properties: Loop

Press save


Put the Oculus headset on again. Reset the scenario and watch it again. 3 seconds after the scenario begins, an alert should sound and the video will change.

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.

Frame launch shortcut

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”.

Final settings for message from Officer Left

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”.

Settings for message from officer right

Settings for message from Officer Right

Click Save.


Reset the scene in the Oculus and you will see the officers give you opposing advice.

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!”

Settings for Inquiry – two choices.

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.

Suggested settings for object playable in the Option 2 branch “Fire Torpedoes”

Click save.


Try the scene again. Because we haven’t authored anything for the event that the user chooses the advice of the officer on the left, you’ll need to select the “Fire Torpedoes” choice to advance the script.


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: