Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

This article describes how to use the Asset Bundler which is part of the Motive Unity SDK. It allows you to upload one or more bundles Bundles to Storyflow directly from Unity.

Once in Storyflow, any asset Asset which is part of the asset bundle Asset Bundle can be injected into a scene Scene using a Storyflow scriptScript.

Video

...

This video follows the same steps outlined below.

Step 1

...

: Unity - Add an Asset Bundle Tag to a Prefab

The prefab Prefab in this example is called Sphere Asset. It has a Motive Scene Object script Script and it has the name MySphere.

Info

Remember the name of the prefab Prefab and the Motive Scene Object.

  1. Select the

...

  1. Prefab you want to add to an

...

  1. Asset Bundle

  2. In the Inspector, go to the very bottom of the tab to the

...

  1. “Asset Bundle” field

  2. Click on the drop down menu and select the name of the Asset Bundle that you want to add this

...

  1. Prefab

    1. If you don’t yet have a name, click New… and type in the name

Info

Important: Do not use spaces or special characters in the name

Step 2

...

: Unity - Use the Motive Asset Bundler

  1. From the main menu bar on the top of the screen, select Motive

...

  1. > Asset Bundler

...

  1. > Window

...

The Motive Asset Bundler has several sections. Below are the instructions for each section.:

Bundle Configuration

  1. Check the box next to the name with which you tagged your

...

  1. Prefab in the step above

Select Build Targets

  1. Check the box next to

...

  1. “Android”

Info

Android is the only option you need for VR

Build Configuration

  1. Click the Choose

...

  1. Folder” button

  2. Select a folder into which the

...

  1. Asset Bundle will be built.

...

  1. This can be any folder. If you are not sure, create a new folder called Asset Bundles and use that.

Server Configuration

Motive Cloud URL

  1. Set this to the URL of your Motive instance

...

  1. (For example, https://preview.motivecloud.dev)

Info

Make sure there is no backslash at the end of the URL

  1. Click the Login button

  2. A nine digit code will appear below the button - make note of the code

Step 3

...

: Storyflow - Authenticate the Asset Bundler

  1. In your Storyflow project, enter the nine digit code into the Authenticate Device text box on the left-hand side

  2. Click the checkmark button

The Asset Bundler is now authenticated.

  1. Return to Unity

Step 4

...

: Unity - Continue with the Motive Asset Bundler

The nine digit code will no longer appear.

Manage Upload

Media Catalog

This is the name of the Media Item

...

Catalog that the

...

Asset Bundle will be placed in your Storyflow project

  1. You can use the default name or choose your own

...

  1. . If the

...

  1. Catalog does not already exist, it will be created for you

Bundle Catalog

This is the name of the Unity Asset Bundle

...

Catalog that the asset

...

Bundle will be placed in your Storyflow project

  1. You can use the default name or choose your own

    1. If the

...

    1. Catalog does not already exist, it will be created for you

Click to load organizations

  1. Click this button to load your organizations

...

  1. Select an organization

Select a Space

  1. Click the button to open a drop down and select your space

Select a Project

  1. Click the Projects button to choose your Storyflow project

Tip

At this point, scroll to the top of the Motive Asset Bundler and click the big green button that says BUILD AND UPLOAD

This may take a few moments to complete. Once it is done, you can close the Motive Asset Bundler window.

Step 5

...

: Storyflow - View the Catalogs (optional)

  1. Go to your Storyflow project

  2. Notice that the following

...

  1. Catalogs now exist:

    1. Media Item

...

    1. Catalog

      1. A Media Item was also added to the Media Library

      2. It is now referenced in this

...

      1. Catalog

    1. Unity Asset Bundle

...

    1. Catalog

    2. Unity Asset

...

    1. Catalog

      1. This contains a

...

      1. Catalog item with the name of your

...

      1. Prefab (Sphere Asset in this example)

Info

While it is possible to create these catalogs Catalogs and define the relationships between them manually, the Motive Asset Bundler provides a quick way to do this automatically.

Step 6

...

: Storyflow - Add the

...

Object to a Named Object Catalog

  1. Remember the name of the Motive Scene Object from step

...

  1. (MySphere in this example)

  2. Add this as a

...

  1. Catalog item to a Named Object Catalog

    1. If you have already done this, you can skip this step

Step 7

...

: Storyflow - Spawn the Asset with a Storyflow Script

  1. Create a

...

  1. new Script

  2. Link the Script to a

...

  1. Scenario

  2. Call the first child

...

  1. Frame Setup

  2. Add a Spawn Asset

...

  1. Resource

  2. Select the

...

  1. Prefab name from the Unity Asset

...

  1. Catalog (Sphere Asset)

  2. Add a Scene Object Resource

  3. Add the object with Motive Scene Object name from step 6 (MySphere)

  4. Add a Scene

...

  1. Anchor(optional)

    1. An anchor is used to define where the Asset will spawn in the

...

    1. Scene

    2. Depending on the

...

    1. Scene, you may want to use different anchors

...

Do these next steps if you are using a Scene Anchor:

  1. Create a child

...

  1. Frame of the Setup frame with the

...

  1. Condition that the Spawn Asset

...

  1. Resource is complete

  2. Add a Move Object

...

  1. Resource

  2. Select the Scene Object from the Objects menu

  3. Select the

...

  1. Anchor from the Anchor menu

Info

Important: Once the Spawn Asset resource Resource is used, you must refer to the object with the Scene Object name from that point on anywhere else in the scriptScript.

Step 8

...

: Unity or Headset

  1. Run the Storyflow

...

  1. Scenario that is linked to the

...

  1. Script created in step 7

The

...

Asset Bundle will be downloaded like any other piece of

...

Media and spawned into the

...

Scene at the coordinates defined in the

...

Anchor.

Info

This lets you inject a new asset Asset into an existing scene Scene without making a new Unity build or needing to redeploy an apk to VR headsets

You can try running the same script Script in another sceneScene. You may want to use a different anchor Anchor in your Storyflow script Script but the asset Asset will appear just as easily in any other scene Scene with the same SF script.Storyflow Script.

Related Articles

Walkthroughs