Example - Unity Scene Import
In this example we’ll import a whole scene as an example, but most of the procedure applies to any scene.
The Unity Asset Store has quite a lot of prebuilt scenes that cover a wide range of genres and styles, but are of very varying quality depending upon their target platform. Some are cartoonish and designed for use on mobile phones, while others are more photorealistic and intended for more powerful platforms. VR is especially expensive so it is best to aim for simpler rather than more complex assets where possible.
It is also worth looking for Unity Asset Store publishers that provide a lot of different scenes, as the quality, naming, scale and other areas will be consistent, so simpler to import and better coordinated when using the assets across different sets.
Scenes in the Unity Asset Store are often used as examples for asset bundles, and as such consist of a setting (interior/exterior) with all the assets fixed in place and fixed. This can be problematical if you decide to film in the scene and need to manipulate the set, such as sit at a table or drive a car. So for practicality, the FirstStage Asset Importer will also strip out all the assets placed on set by the publisher so that they can be selected in the FirstStage Asset Browser, but also place them back into the scene so that it can be loaded fully intact and usable.
Follow the links after each instruction for a more detailed guide.
Suppose we are blocking out a fight scene in a restaurant. We may have tried various ideas out on the Empty Stage using sketched shapes and stock props but we now want to move somewhere better.
Searching for a restaurant environment turns up some promising candidates, and we will choose the modular Restaurant environment published by PIOPIS. It’s not quite what we wanted but close enough to work with, and we can always adapt it with a bit of set dressing. This is also not a free asset, but at €35 it offers fabulous value considering the amount of cost and effort it would take to create all of the assets contained within it.
Downloading and importing from the Unity Asset Store
From the Unity Editor, download and import the scene asset.
First, lets get organised and rename the Asset root folder from ‘Assets Main Folder’ to ‘PIOPIS’ (the Publisher’s name) to help with identification later on.
We will be making changes to the scene, so it is worth retaining the original by taking a copy of the ‘restaurant’ scene file in ‘Assets > Sample scene’ and putting it in the Asset root folder (PIOPIS). Open the newly copied scene to view and check for any obvious visible issues.
You should also check the Console window for errors when it loads. We cannot possibly anticipate what errors could occur and how to deal with them, but do recommend Googling the error message for guidance.
Preparing the asset
Set the Floor layer
FirstStage needs floor geometry marked to allow users to teleport onto it and for characters to walk on it. Unity does this by putting objects into different layers.
Firstly, we need to locate the assets that make up the floor. Fortunately, the Restaurant assets are well named and organised by type, making it much easier to identify and select the floor objects by searching for “floor” in the Hierarchy window, which seems to locate all the floor tiles.
Selected, in the Inspector view, change the Layer to Ground. When the Unity Editor asks whether it should do this for children also, click Yes.
We also want to make stairs walkable on so select those (easiest is to seach for “stair”) and change the Layer to Ground on them also.
Remove existing cameras
Example scenes often have a Player GameObject (often named ‘Player’ or ‘Controller’) to demonstrate the scene. If your scene has an obvious player object, or a camera rig, these objects should be removed as they will conflict with FirstStage when loaded.
Set the inital spawn point
In the scene root, create an empty game object called "LOCAL_USER”. Place it at ground level where you would want to enter the scene.
Test the scene
Open the FirstStage Repository view if it is not already open and make sure the LOCAL project is selected while we are testing the scene.
Select the scene asset in the Project view (you can jump to it from the Scene Hierarchy by right clicking on the scene name).
Press the Import button in the FirstStage view. You should now find your scene listed under the Pending group.
You can add a description to your scene to help when listing them in the FirstStage Office: select the scene and add a description in the right hand panel.
Now press the Commit button. The Unity Editor will freeze and pause briefly while the asset bundle is created.
Check the Console view in case any errors show up.
Now launch FirstStage and go to your project and create a new scene: the new stage (in our case, Restaurant) should appear in the list of available stages.
Once on set, you can have a look around and see how well it is working. You may find objects you missed when setting the floor layer.
Import supporting assets
What you will notice is that the props in the scene (e.g., tables, chairs) can not be interacted with: moved, deleted, etc. At this point they are just static set dressing.
To make the props interactive, we need to go back to the Unity Editor and import any supporting assets that we will want to interact with. This has the additional advantage of those assets to be placed on other stages as well.
Well organised packages will have their assets organised and typically there is a folder “Prefabs” and, in the case of the Restaurant package, there are several such folders organised by category.,
Most props can be imported without any further ceremony if they are just set dressing with no additional behaviour.
Select all the prefabs you want to import (do them in batches if easier) and press the Import button in the FirstStage repository view.
Note that some of the prefabs may be part of the construction of the building and background — walls, floors, etc., — we don’t usually want to manipulate these and so are best omitted from the import.
When we are happy with our collection of prefabs to import, press the Commit button.
We might also want to add some tags to our new assets to make them easier to find inside FirstStage.
Identify stage things
Now the prefabs are in the repository, we can identify all the game objects in the scene that are from an asset prefab so that FirstStage can work with them.
Simply select the menu option Moviestorm > Identify Stage Things
Test the scene with separate assets
Now we need to import and commit our scene again.
Launch FirstStage again and go back to the scene you created previously. You should now find that you can select and grab things in the scene which are instances of the assets you just imported.
We are now free to dress the set as we want it: removing things we don’t want, moving things where we do want and adding more things out of the asset repository.
Commit to the cloud
If you want anyone else in your project team to use this set or any of the assets you’ve imported, you need to commit them to the cloud.
In the Unity Editor, FirstStage repository view, change the Project from LOCAL to the one you are working on and then press the Commit button.
Again Unity will freeze as it builds the bundles, and it will take a bit longer this time as it has to upload the asset bundles to the server.
Once you start working on the scene, you may find more changes you need to make to the base set. In which case you can just repeat the above process. Always test changes in the LOCAL repository first and only commit to the cloud when it is working.