Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

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

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

Point And Shoot Tutorial2.mp4

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 Objects Motive Scene Objects. We will do this by right clicking the 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 Cube=Target and my Cylinder=Tool

Step 2: Configure your tool

  1. The next thing we want to do is add Point And Shoot to our Cylinder, we will do this my right clicking the 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 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 Cylinder. To do this, we will right click our Object in the hierarchy and create an empty child, let's name this raycast.

  3. Then, we will move the transform to the end of Cylinder and orient it with the blue arrow pointing the direction we want to cast.

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

  5. While we are here, let's add some haptic feedback and lower the distance down to one.

  6. Finally, let's add a grab anchor to the Cylinder to make it easier to hold. Again let's right click it in the hierarchy, and create empty, this time let's name it Grab Anchor.

  7. let's move the grab anchor to the base of the 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 Cylinder, let's orient the blue arrow towards the top.

  8. 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 Catalog. Create a Catalog named My Objects, and to this Catalog we will add Target and Tool.

  2. Open the relevant Script or create a Script

  3. In a new frame, add the Use Tool Resource.

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

  5. Add an Event "complete" and in this final Frame we can add a Screen Message Resource (Playable Content type),

  6. Give it the title of Detected!

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

 

  • No labels