Develop
Develop
Select your platform

Create Ghost Reticles

In this tutorial, you learn how to create ghost reticles that appear when you hover over a distant cube. Ghost reticles are semi-transparent outlines that indicate when you’re currently selecting or hovering over a distant object. The reticles in Interaction SDK are automatically added via QuickActions. The reticles can display cursor icons on objects, outline meshes, and draw lines from your hand to an object’s current position.
To try ghost reticles in a pre-built scene, see the DistanceGrabExamples scene.

Before you begin

Create a distance grabbable GameObject

Ghost reticles are meant to be used with distant objects, so your scene needs a GameObject that’s grabbable from a distance. To make that GameObject, you’ll use QuickActions.
  1. Open the Unity scene where you completed Getting Started with Interaction SDK.
  2. Create an empty GameObject named Cube by right-clicking in the Hierarchy panel and then clicking 3D Object > Cube.
    A cube appears in the Scene view.
  3. In the Hierarchy, select Cube.
  4. In the Inspector, in the Transform component, in the Position field, set the axis values to the following.
    • X: 0
    • Y: 0.7
    • Z: 0.5
  5. In the Scale field, set the axis values to the following.
    • X: 0.27
    • Y: 0.27
    • Z: 0.27
  6. In the Hierarchy, right-click on Cube, and then select Interaction SDK > Add Distance Grab Interaction.
    The Distance Grab Wizard appears.
  7. In the Distance Grab Wizard, in the Settings tab, in the Add Required Interactor(s) dropdown, select Nothing, since the camera rig includes distance hand grab interactors by default.
  8. In the Distance Grab Type dropdown, select one of the following options to determine how the cube will respond to distance grabs and what kind of ghost reticle it will use.
    • Grab relative to hand, which displays a reticle on the cube’s surface during a hover.
    • Pull interactable to hand, which displays an outline of the cube in your hand during a hover.
    • Manipulate in place, which displays a line between your hand and the cube’s surface during a hover.
  9. In the Supported Grab Types dropdown, select one of the following options. This determines which grab types the cube will respond to.
    • Grab
    • Everything
    • Pinch
    • Palm
    • All
    In the Distance Grab Wizard, every dropdown in your Settings tab should now have a value. Depending on your selections, your Distance Grab Wizard may look different from the screenshot.
    Settings tab of wizard
  10. In the Distance Grab Wizard, in the Required Components tab, click the Fix All button.
    Fix all button
    The wizard auto-fills the components that don’t have a value.
  11. (Optional) In the Distance Grab Wizard, in the Optional Components tab, click the Fix All button.
  12. At the bottom of the Distance Grab Wizard, click the Create button.
    In the Hierarchy, a new GameObject named ISDK_DistanceHandGrabInteraction is added as a child of your Cube GameObject.
  13. Prepare to launch your scene by going to File > Build Settings and clicking the Add Open Scenes button.
    Your scene is now ready to build.
  14. Select File > Build And Run, or if you have a Link connected, click Play.
    The scene loads. When you hover over the cube, the value you provided in the Distance Grab Type dropdown determines which reticle appears and how you can interact with the object.
    If you chose Grab relative to hand, when you hover over the Cube with either hand, a circular reticle appears.

    Video 1: Link view showing the ghost reticles when the hands hover over the cube.

    If you chose Pull interactable to hand, when you hover over the Cube with either hand, an outline of the object appears in your hand.

    Video 2: Link view showing the cube outline when each hand hovers over the cube.

    If you chose Manipulate in place, when you hover over the Cube with either hand, a line appears between your hand and the object.

    Video 3: Link view showing a line between the hand and object when hovering over the cube.

Did you find this page helpful?