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. |
Select the
...
Prefab you want to add to an
...
Asset Bundle
In the Inspector, go to the very bottom of the tab to the
...
“Asset Bundle” field
Click on the drop down menu and select the name of the Asset Bundle that you want to add this
...
Prefab
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
From the main menu bar on the top of the screen, select Motive
...
> Asset Bundler
...
> Window
...
The Motive Asset Bundler has several sections. Below are the instructions for each section.:
Bundle Configuration
Check the box next to the name with which you tagged your
...
Prefab in the step above
Select Build Targets
Check the box next to
...
“Android”
Info |
---|
Android is the only option you need for VR |
Build Configuration
Click the “Choose
...
Folder” button
Select a folder into which the
...
Asset Bundle will be built.
...
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
Set this to the URL of your Motive instance
...
(For example, https://preview.motivecloud.dev)
Info |
---|
Make sure there is no backslash at the end of the URL |
Click the Login button
A nine digit code will appear below the button - make note of the code
Step 3
...
: Storyflow - Authenticate the Asset Bundler
In your Storyflow project, enter the nine digit code into the Authenticate Device text box on the left-hand side
Click the checkmark button
The Asset Bundler is now authenticated.
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
You can use the default name or choose your own
...
. If the
...
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
You can use the default name or choose your own
If the
...
Catalog does not already exist, it will be created for you
Click to load organizations
Click this button to load your organizations
...
Select an organization
Select a Space
Click the button to open a drop down and select your space
Select a Project
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)
Go to your Storyflow project
Notice that the following
...
Catalogs now exist:
Media Item
...
Catalog
A Media Item was also added to the Media Library
It is now referenced in this
...
Catalog
Unity Asset Bundle
...
Catalog
Unity Asset
...
Catalog
This contains a
...
Catalog item with the name of your
...
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
Remember the name of the Motive Scene Object from step
...
(MySphere in this example)
...
Catalog item to a Named Object Catalog
If you have already done this, you can skip this step
Step 7
...
: Storyflow - Spawn the Asset with a Storyflow Script
Create a
...
...
Call the first child
...
Frame Setup
Add a Spawn Asset
...
Select the
...
Prefab name from the Unity Asset
...
Catalog (Sphere Asset)
Add a Scene Object Resource
Add the object with Motive Scene Object name from step 6 (MySphere)
Add a Scene
...
Anchor(optional)
An anchor is used to define where the Asset will spawn in the
...
Scene
Depending on the
...
Scene, you may want to use different anchors
...
Do these next steps if you are using a Scene Anchor:
Create a child
...
Frame of the Setup frame with the
...
...
...
Select the Scene Object from the Objects menu
Select the
...
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
Run the Storyflow
...
Scenario that is linked to the
...
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.