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 3 Next »

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

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.

  • 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. I will then give each of these a name, I will call my cube "Target" and my cylinder "Tool".

2. Configure your tool

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

  • 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, lets name this raycast. 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.

  • Now lets drag Raycast into the Raycast transform box of the Usable Point Click Action.

  • While we are here, lets add some haptic feedback and lower the distance down to one.

  • Finally, lets add a grab anchor to the cylinder to make it easier to hold. Again lets right click it in the hierarchy and create empty, this time lets name it Grab Anchor.

  • Lets 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, lets orient the blue arrow towards the top.

  • Next we drag the Grab Anchor into the Grab Anchor box of VR Grabbable

3. Unity Test 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.

4. Storyflow

  • First thing we want to do is add our Motive Scene Objects to a catalog. Lets make a catalog named My Objects, and to this catalog we will add Target and Tool.

  • Now lets add these to our script.

  • In a new frame, add the Use Tool resource. For the World Object we will select Target, and for Use Tool we will select Tool.

  • Lets add event "complete" and in this final frame we can add a playable screen message, Lets give it the title of Detected!.

5. Unity Test 2

  • Now back in unity, lets 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.

  • No labels