Your Second Scenario – Choose the Right Object

Choose the Right Object

In this scenario there will be a fire in the kitchen. The trainee will need to decide whether to put the fire out by smothering it with the pot lid or throwing water on it.

Navigate to the “Choose the Right Object” Script

From the dashboard, select the “Choose the Right Object” script.

Add a new frame

In the editor, you will notice that the script is set up the same way the “Tool Usage” Script was. The scene objects are already there.

Add a new frame, name it “Light Fire”.

Add a “Span Asset” resource

Drag a “Spawn Asset” resource into the work area. Configure it as follows:

  1. Choose the “Kitchen Fire” asset from the Unity assets catalog that pops up
  2. Select “Relative Position” from the “Position” drop-down
  3. Position the fire by anchoring it to the Pot on the Stove

Add a screen message to prompt the user to take action

Select and “Object Playable” resource and drag it into the work area of the same frame (you will now have two resources in this frame).

  1. Choose “Screen Message” for your content type
  2. Add the instructions to the text fields

Create an Inquiry to Have Trainee Decide the best way to Extinguish the Fire

Add a subframe below the “Light Fire” frame by clicking on the ‘+’ at the end of the “Light Fire” frame

Add an “Inquiry” resource

Drag and “Inquiry” resource into the new frame’s work area. Configure it as follows:

Select “Choose between multiple objects” for the inquiry type.
The first object you could use to put out the fire is the pot lid. Choose it. Add a text prompt that says “Put the fire out with the pot lid”
Add a second choice by clicking the ‘+’ button beside “choice” again. The second option for putting out the fire is the mug of water.

Create Option Outcomes by Branching

We will create branched outcomes using the same method we used in the last tutorial.

Option 1 – Pot Lid

Click the ‘+’ symbol beside option 1.

Author outcome for option 1 – smother

In this scenario, the correct action is using the pot lid. For brevity, we will just have the fire go out when the pot lid is selected. It would be more realistic to have the user pick up the put lid and put it on the pot. This is possible, but for now, the fire will go out when the pot lid is clicked. We need to add a “Deactivate Resource” resource to stop the fire.
The “Deactivate Resource” resource will look like this:

Option 2 – Throw Water

Go back to the “Choose Object” frame and click the ‘+’ beside option 2 in the “Inquiry” resource in the work area. This creates a second branch with a new frame.

Author outcome for option 2- water

In the new frame for option 2 – throw water, let’s tell the trainee they got it wrong. We will attach a notification to the pot that says “The fire is still burning!”
Drag an “Object Playable” into the work area of the new frame. Configure as follows:

  1. Attach the object playable to the pot so that the notification shows up above it.
  2. Be sure that the object playable type is a “Notification”. Add the notification text to let the trainee know they made the wrong decision.

Save and Test

Save your script and try it in the app. Be sure to select “Reset” from the app menu, then select the “Choose the Right Object” scenario. If you haven’t already, you will need to navigate into the kitchen by tapping on the green navigation pads throughout the house. The kitchen is near the back of the house.