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

Version 1 Next »

Overview

This article describes how you can implement Motive’s premade Sliding Joint component to connect 3D assets and have them interact as if they were connected on rails. With only a few minor changes made in Unity, this functionality allows for easy and fast interaction that can be used in conjunction with other Motive premade features such as, VR Attachable, VR Attachable Receiver and VR Grabbable.

Setup - Unity SDK

  1. Open your Unity project and in the scene Hierarchy window find “World”

  2. Right-click on World then select (Create Empty) and name your new empty object “Slide Remove Example”

  3. In your Slide Remove Example Inspector window select (Add Component > (Type in “Rigidbody”) > Rigidbody)

    1. Toggle Use Gravity to off

    2. Toggles Is Kinematic to on

  4. Right-click on Slide Remove Example and make a child object by selecting (3D Object > Cube)

    1. Name this cube “Stationary Cube”

    2. In the Stationary Cube Inspector window under the Box Collider component toggle Is Trigger to on

    3. Next, add a Rigidbody to the Stationary Cube as you did before

      1. Once again you need to toggle Use Gravity to off and Is Kinematic to on

  5. Right-click on Stationary Cube and make a child object by selecting (Create Empty)

    1. Name this object “Sliding Joint”

    2. Right-click on the Sliding Joint and select (Motive > Joints > Add Sliding Joint)

    3. In the Rigidbody component disable Use Gravity

    4. In the Sliding Joint component click on the box next to Connected Rigidbody and delete that object

    5. Into that same box drag the Slide Remove Example object you just made

    6. Next, in the same component toggle Limit Motion to true

      1. Then in the box beside Upper Limit type 0.1

  6. Right-click on Sliding Joint and select (Motive > Make Attach Receiver)

    1. Scroll down to the new Attach Receiver component expand the Colliders dropdown and expand the Size to 1

    2. In the new Element 0 area drag in Stationary Cube

  7. Right-click on Sliding Joint and make a child object by selecting (Create Empty)

    1. Name this object “Removable Part”

    2. Right-click on the Removable Par and select (Motive > Make Grabbable)

    3. In the VR Grabbable component toggle Track Orientation to off

    4. Find the Box Collider component and select the *Three dots* on the top right of the component, then select Remove Component

    5. Under the VR Attachable component expand the Attached Grab Settings dropdown then select the Release Behaviour dropdown and then click on Leave in Place

    6. Then in the same Attached Grab Settings dropdown change the Move Mode to Physics

    7. While you are still in the VR Attachable component scroll down to find the Attached To field, and delete whatever object is in that box

    8. Then slightly lower you can toggle Requires Detachable to on

    9. Next, expand the Guide Meshes dropdown and increase Size to one

  8. Right-click on Removable Part and select (Motive > Joints > Add Fixed Joint)

  9. Right-click on Removable Part again and select (3D Object > Cube)

    1. Name this cubeSliding Cube”

  10. Go back to Removable Part now under the VR Attachable find Element 0 under the Guide Meshes dropdown

    1. Drag Sliding Cube into the box beside Element 0

  11. Now, go back to Sliding Joint and under the Sliding Joint component in the Upper Stop dropdown menu, you need to hit the + icon under In Limit ()

    1. Then, you need to drag Removable Part into the box that reads None

    2. From there select the No Function dropdown menu and select (VR Attachable > SetDetachable ())

  12. Next, you must select the Slide Remove Example object and either using the *Arrow* shown in the Scene view or the Position values under the Transform component you just move the object somewhere easily accessible in the Workshop scene

    1. (X: 1.588, Y: 0.448, Z: 2.139 works well)

  13. After, that it would be best to reduce the Slide Remove Example Scale to 0.5 on both the X, Y and Z axis, these values can also be found under the Transform component

  14. Then select Sliding Cube in the Hierarchy window and change its scale values to 0.3

  15. Then, using the *Arrows* as mentioned before or the Position fields under the Transform component you should move Sliding Cube so it is visible

    1. These position values work well (X: 0, Y: 0.62, Z: 0)

  16. Save the scene

Setup - Storyflow

  1. Open Storyflow and select the Catalogs tab

  2. If you do not have a “Named Anchor” catalog already, select (Create > Select Type > Named Anchor > (Type a name) > Create)

  3. Open your “Named Anchor“ catalog then select (+ > Named Anchor > (Type in “Anchor1”) > Save)

  4. Save the catalog

  5. Open the Scenarios tab and select (+ Add a New Script > (Type a name) >
    Checkmark > (Newly Created Script))

  6. Under Resources on the right side of the screen click and drag the “Scene Anchor” resource into
    the grey area in the center of the screen

    1. Select (Anchor + > (Your Named Object catalog) > Anchor1 > Save

  7. In the same grey area mentioned before put the Guide “Screen Message” resource there

    1. “Screen Message” can be typed into the Resource search bar for easy access

  8. Select the drop-down menu under Anchors and select Anchor1

  9. Under Text type “Great work”

  10. Select Save on the top left of the screen

  11. Next, select the Project tab on the top of your screen then go (Create > Script + >
    [Project name] Scripts > (Your new script) > Title > (Type a new scenario title) >
    Save)

You can now open your Unity project select the newly created scenario, and see your newly made notification!

  • No labels