Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
panelIconId1f393
panelIcon:mortar_board:
panelIconText🎓
bgColor#4C9AFF

In depth learning on Usable World Objects is found in this course in Motive Academy.

Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse

Overview

This article describes how to configure Motive > Usable Actions > Point And Shoot. Point And Shoot allows us to detect when a user points a tool and uses it on a predefined objectObject.

...

Step 1

...

: Identify your

...

Objects

For this example, I am going to use two

...

Objects: a

...

Cube as my Target, and a

...

Cylinder as my Tool.

  1. The first thing we want to do is make both of these

...

  1. Objects Motive Scene Objects. We will do this by right clicking the

...

  1. Object in the hierarchy, and then selecting Motive > Make Scene Object.

  2. I will then give each of these a name, I will call my

...

  1. Cube=Target

...

  1. and my

...

  1. Cylinder=Tool

...

Step 2

...

: Configure your tool

  1. The next thing we want to do is add Point And Shoot to our

...

  1. Cylinder, we will do this my right clicking the

...

  1. Object in the hierarchy and then selecting Motive > Usable Actions > Point And Shoot. You will notice that this adds a number of components to our

...

  1. Object including VR Grabbable, Usable World Object, and Usable Point Click Action.

  2. Now we want to set up where we want to output our raycast from the

...

  1. Cylinder. To do this, we will right click our

...

  1. Object in the hierarchy and create an empty child,

...

  1. let's name this raycast.

  2. Then, we will move the transform to the end of

...

  1. Cylinder and orient it with the blue arrow pointing the direction we want to cast.

  2. Now

...

  1. let's drag Raycast into the Raycast transform box of the Usable Point Click Action.

  2. While we are here,

...

  1. let's add some haptic feedback and lower the distance down to one.

  2. Finally,

...

  1. let's add a grab anchor to the

...

  1. Cylinder to make it easier to hold. Again

...

  1. let's right click it in the hierarchy, and create empty, this time

...

  1. let's name it Grab Anchor.

...

  1. let's move the grab anchor to the base of the

...

  1. Cylinder. To orient it in our hand, imagine the green arrow points up, the red arrow points right, and the blue arrow points forward. Since we want to point with the

...

  1. Cylinder,

...

  1. let's orient the blue arrow towards the top.

  2. Next we drag the Grab Anchor into the Grab Anchor box of VR Grabbable

Step 3: Unity Test 1

  1. Now if we start our Unity scene we can pick up our Cylinder, we can see we are holding it pointing away from us and if we pull the trigger we can feel haptic feedback.

For now this is all that it will do. To add the rest of the behaviour, we will move over to Storyflow.

Step 4: Storyflow

  1. First thing we want to do is add our Motive Scene Objects to a

...

  1. Catalog.

...

  1. Create a

...

  1. Catalog named My Objects, and to this

...

  1. Catalog we will add Target and Tool.

...

  1. Open the relevant Script or create a Script

  2. In a new frame, add the Use Tool

...

  1. Resource.

  2. For the World Object we will select Target, and for Use Tool we will select Tool.

...

  1. Add an Event "complete" and in this final

...

  1. Frame we can add a

...

  1. Screen Message Resource (Playable Content type),

  2. Give it the title of Detected!

...

  1. Create a Scenario

  2. Link the Script you created to the Scenario

Step 5: Unity Test 2

Now back in

...

Unity,

...

let's run the script.

When we grab the

...

Cylinder it should be pointing away from us, and when we squeeze the trigger we should feel some haptic feedback in our controller.

At a distance, pointing towards the target and pulling the trigger wont display our message, but if we come within range, we see that it does.

Related Articles

Configure One Object to be Used On Another

Hand-Activated Sanitizer

Barcode Reader