Learn to author the "Equip" action to put on a hard hat.
Object interactions are used to dictate the way the user interacts with objects in the scene. In the previous tutorial, the user could pick up the hard hat, but could not put it on. In this tutorial, we'll explore how to use the "equip" action to allow the user to put on the hard hat.
Step 1: Create a new frame in the "Equip Hard Hat" script
The following steps will make the equip action available after the audio cue has cleared.
- Start in the "Equip Hard Hat" script.
- Re-name the "Notification" frame to "Equip Hard Hat":
- Click the blue "+" shortcut at the bottom of the audio resource.
- Select "close" from the list.
A new subframe will appear as in the video below.
If the video is too small, mouse over the bottom right and click on the fullscreen icon after you hit play.
As in the previous tutorial, the new subframe you created will already have the "Object event" condition in it, which in this case, indicates that the resource frame will fire after the audio file closes.
Step 2: Add a scene object
In order for the equip action to work, we need to specify the item that the trainee will put on.
- Search Resources for "Scene Object".
- Drag "Scene Object" into your frame.
- Click on the "+" beside "Object".
- Select "Safety Hat" from the "Workshop Objects" catalog.
Step 3: Add an equip target
In order for the equip action to work, we need to specify the "equip target" - think of it as the "landing place" for the item. In this case, the equip target will be the trainee's head. We could drag an "Equip Target" resource into the frame like we just did above - but let's just add this via the catalog.
- Click on the Catalog icon.
- Click on "Workshop Equip Targets".
- Drag the "Head" target to the frame.
Step 4: Add the "Equip" action
- Search Resources for an "Equip" resource.
- Drag it into the same frame as the scene object and equip target.
- Fill in the equip resource as follows, to identify that you want the safety hat to be equipped on the trainee's face.
- STOP: Save and test in the headset. You should now be able to pick up the hard hat using the grip button on the side of the controller and bring it toward your head. The hard hat will "attach" to your head, and you'll be able to see the hard hat in your peripheral vision.
Step 4: Add a success notification
Once the trainee puts on the hard hat, we want to reinforce that they have completed the task correctly by adding another notification.
We want the notification to activate when the trainee has successfully equipped the hard hat.
- Ensure you are in the "Equip Hard Hat" script.
- Click on the blue "+" on the bottom of the equip resource.
- Select close from the menu.
This will open a new subframe, which will automatically have an "Object Event" condition, activating the notification, after the trainee has successfully put on the hard hat:
Your script tree should now look like this:
- Search for/drag a "Notification" resource into the "On Safety Hat - Equip close" Frame.
- Add a message for the trainee into the message section:
- Add a sound by clicking on the "+" beside sound.
- Click on the Workshop Sound Effects catalog and click on "Notification 1".
- Add an image, by clicking on the "+" beside "image".
- Click on the Workshop Icons catalog, and then click on the icon "Correct":
- STOP: Save and test in the headset. Now, when you put on the hard hat, a notification should pop up telling you that you were successful.
In the Headset
Key Takeaways from Tutorial 5
- Once you've identified the Scene Object and the Equip Target (landing place) resources, you can use the Equip+ resource to enable the learner to understand what item within the scene should go where.
- The Object Event condition can activate a notification after successful task completion. By using sounds, text, images, and more you can reinforce a learner's success.