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 Scene Configuration can be found in this course in Motive Academy.

Create an Object that is attached to another object Object and needs to be slid before it can be removed. This example describes how to create a cube Cube which sits on top of another cubeCube. When slid to a specific point, it can be removed.

...

Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse

Overview

The object hierarchy will look like this:

...

Slide Remove Example

  1. Create an

...

  1. Empty Object in Unity. Add the following:

Rigidbody

Field

Value

Use Gravity

false

Is Kinematic

true

Stationary Cube

  1. Add a 3D cube as a child of Slide Remove Example. Add or configure the following:

Rigidbody

Field

Value

Use Gravity

false

Is Kinematic

true

Box Collider

Field

Value

Is Trigger

true

Sliding Joint

  1. Create an

...

  1. Empty Object as a child of Stationary Cube

...

  1. Right click on the Sliding Joint

...

  1. Object

  2. Select: Motive

...

  1. > Joints

...

  1. > Add Sliding Joint

This will add a Rigidbody and a Sliding Joint. Configure them this way:

Rigidbody

Field

Value

Use Gravity

false

Is Kinematic

false

Sliding Joint

Field

Value

Axis

(0,0,-1)

Connected Rigidbody

Slide Remove Example

Limit Motion

true

Upper Limit

0.1

Upper Limit: In Limit

Slide Removable Part; VRAttachable.SetDetachable()

Info

*You will need to come back to this section at a later point to set the Upper Limit: In Limit value. The object, Slide Removable Part, has not been created at this point. It will be the child of the Sliding Joint object.

  1. Right click on the Sliding Joint

...

  1. Object

  2. Select: Motive

...

  1. > Make Attach Receiver. This will add a VR Attachable Receiver.

VR Attachable Receiver - Colliders

Field

Value

Size

1

Element0

Stationary Cube

  1. (Optional) Add a Joint Effects component

...

  1. :

Joint Effects - Upper Limit Reached

Field

Value

Haptic Effect

Bump

Slide Removable Part

  1. Create an

...

  1. Empty Object as a child of Sliding Joint

...

  1. Right click on it and select: Motive → Make Attach Receiver. This will add a VR Grabbable and a VR Attachable.

  2. Delete the Box Collider. It is not needed.

VR Grabbable

Field

Value

Track Orientation

false

VR Attachable - Attached Grab Settings

Field

Value

Release Behaviour

Leave in Place

Move Mode

Physics

VR Attachable - Detached Grab Settings

Field

Value

Release Behaviour

Return

Move Mode

Kinematic

VR Attachable

Field

Value

Attached To

None

Requires Detachable

true

Joint

Slide Removable Part

Info

*Joint will populate automatically when the Fixed Joint is added. This step will happen later.

VR Attachable - Guide Meshes

Field

Value

Size

1

Element0

Sliding Cube

Info

*Sliding Cube will be created later and will need be added here after that is complete.

  1. Right click on it and select: Motive → Joints → Add Fixed Joint. This will add a Fixed Joint

...

  1. :

Fixed Joint

Field

Value

Connected Rigidbody

Sliding Joint

Sliding Cube

  1. Add a 3D

...

  1. Cube as a child of Slide Removable Part

...

  1. Reduce the size of the Cube so it is smaller than the Stationary Cube

  2. In the Scene, position the Sliding Cube on top of the Stationary Cube

Items to Check

Some steps need to happen after the required objects are created. Double check these settings:

  • Sliding Joint

    • Upper Limit : In Limit

  • Slide Removable Part

    • VR Attachable - Joint

    • VR Attachable - Guide Meshes

Related Articles