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 Attachable Basics is found in this course in Motive Academy.

Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse

Overview

This article describes how to make a cube (our bottle) with a sphere (our cap) attached to it as a child. And, make it so both the cube and the sphere can be grabbed and moved around separately, then reattached.

We will do this using three premade Motive SDK features.:

  • VR Attachable

  • VR Attachable Receiver

  • VR Grabbable

Setup

For this example, we are starting with this relatively simple two-part “Bottle and Cap”:

...

  1. Make an empty child object of “CubeBottle”

...

  1. Set the transform so the location matches that of the child object.

...

  1. Give it a name such as placeholder

...

  1. AttachPointso it is easy to keep track

...

  1. of

  2. Right-click on the Cube in the Hierarchy window

...

  1. Select Motive > Make Grabbable

...

  1. Ensure Is Trigger in the Box Collider component is checked False

...

  1. Add a second smaller collider that is placed where the “cap” is meant to attach

...

  1. Set Is Trigger to True. (This makes it so the cap and the bottle both behave so that they cannot fall through the floor. But, can reattach)

...

  1. Right-click on the Cube again

...

  1. Select Motive > Make Attach Receiver

...

  1. Right-click on the Sphere

...

  1. Select Motive > Make Attachable

...

Now all the necessary components have been added.

...

Next we will make it so the Attachable and the Attachable Receiver can talk to each other.

  1. Expand the VR Attachable Receiver component on the Cube

  2. Expand the Receivers dropdown and type 1 into the size

...

  1. Set the Type to something easy to remember. In this case we will just put

...

  1. Test

...

  1. Set Max Attachments to 1

...

  1. Expand the VR Attachable component on the Sphere

  2. Expand the Attaches To dropdown and type 1 into the size

...

  1. Set the Type to the same string used before. In this case, “Test”

...

  1. Drag and drop your previously made “AttachPoint” into the Receiver Attach Point box:

    Image Modified

Related Articles

Recipes