Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

For an overview of Resources, click here.

Panel
panelIconId1f393
panelIcon:mortar_board:
panelIconText🎓
bgColor#4C9AFF

Deep Learning on Resources is found in Motive Academy. Click here to see the course this lesson is in.

Table of Contents

Overview

The Spawn Asset resource Resource allows the author to spawn any type of asset instance into a sceneScene. The asset is spawned at the specified position.

...

  • Unity Assets

  • Binary Assets

Required Fields

...

Field Name

Description

Asset Instance

Specifies the asset to be spawned. Only Unity Assets can be attached to this field. The Assemblers will create these that include either one prop or most commonly a collection of props. These likely have the position built in.

Optional Fields

Field Name

Description

Position

Specifies the position at which the asset should spawn and used if the Assembler has not set the position of the Unity Asset.

This position can be one of two types: Fixed Position or Relative Position.

The Fixed Position setting allows the author to configure the coordinates of the Positional Anchor, as well as its rotation.

The Relative Position setting allows the author to configure the angle, distance, and elevation of the Positional Anchor, as well as its rotation.

More information on positioning can be found here:

Fixed and Relative Positions

Events

Open, Activate, Complete

Using End Script Resource

If you use an End Script Resource in the same Script as this Resource, the Spawned Assets Resource will close - meaning they will disappear. An alternative to using the End Script Resource is to create a Custom Event marking the end of the Script and then use that Event as a Condition where needed in other Scripts. At Motive we commonly create a Global Event called “Assets Spawned” for use throughout the Project.

To learn more about Finishing Scripts, click here.

Example in the Headset

I have a character named Stacey and I want her to appear at the office door in my scene.

  • Add Position to the script with an anchor (from your own catalog):

...

  • Drag and drop the Spawn Asset Resource into the frame.

  • Choose an Asset from your catalog.

  • Choose Relative Position.

  • Link the anchor from the frame above:

...

  • Save and test in the headset:

...

In the Motive Lab, I want to spawn the supplies, lab equipment, and more.

  1. Add a Spawn Asset resource to the frame

  2. Click on “Asset Instance” then “Asset” and you will see that the catalogs for any created Unity Assets appear:

...

  1. Choose the Unity Asset

In my example, I’ve created several Spawn Asset Resources, and attached the Unity Assets to each:

...

  1. It is very important to remember that you do not want to use an End Script Resource in a Script that has Spawned Assets. If you do, the assets will disappear. Instead, it’s recommended to create an “Assets Spawned” Custom Event that is Global, so that you can use it anywhere in the Project as a Condition:

...

Training Tip:

If you are spawning a large number of assets at once, it can lead to some stuttering in the headset. To mitigate the motion sickness that can result, you can fade the Scene out while the assets spawn. We also suggest using a Screen Message Resource to let the learner know what is about to happen.

In this example, here is what the Frames would look like with the Fade Out/In and Screen Message:

...

Here is what this would look like in the headset, complete with the Fade Scene and Screen Message tips:

...

To view this video in full screen, please click here.

Related Articles

Custom Event Resource

End Script Resource

Fade Scene Resource