Customizations to an Objects Behaviours, Components, and Parameters can be saved for later use.
Presets are a way of saving the settings of an object so that you can reuse it without having to re-apply your preferred Parameters, Behaviours, Components, Messages or Triggers every time.
Not only does this save time when re-using a specific Object, but it allows you to customise Objects that might not appear in your experience until after a trigger occurs.
Let's take a look at how you can quickly and easily set up a Preset.
For this example, we’re going to create a Preset for an enemy that drops a coin when defeated.
First, select an Asset to customize and drag it into the scene.
For this example, we'll use this Skeleton Warrior.
Add Object to Scene - click to enlarge
In the Properties Panel make the necessary edits to the Behaviours and Components.
To make this Skeleton Warrior aggressive towards the player open Behaviour and choose Melee Enemy.
The Melee Enemy Behaviour adds a Health Component to the Object by default so the Enemy can be defeated.
Adjust the parameters to suit your needs by opening Edit Logic.
Customise a Preset - click to enlarge
So that this Skeleton Warrior drops a coin when defeated click Add Components and choose Drop.
Leave Drop Condition to ‘Death’ and change the Type of Drop to Behaviour.
Type of Drop also has an option for Preset. Once you have a Preset saved, this lets you use your Preset to customize elements that haven't appeared in your experience yet.
For Asset to Spawn we'll use a Flashing SAND Coin from the Marketplace, and add the Collectable Component so that it can be collected by the avatar when it drops.
With our Object customised with Behaviours and Components, we are ready to save it as a Preset.
To save a Preset navigate to the left toolbar and select the cube with a plus symbol
The Preset tool will turn from white
when you have an Object selected.
A pop-up window will display an option to create a new Preset, as well as any existing presets you already have.
Click Create New and give the Preset a name, then click Done.
Save a Preset - click to enlarge
It’s that simple. Now the Preset is ready to use.
To access Presets open the Library by pressing (L) and then navigate to the filter list on the left-hand side of the screen and click Preset.
Even if a single instance of a Preset is deleted from a scene it can be easily recovered from the Library.
Presets can be added to the toolbar or placed directly into your scene like any other Object, except that it already has the customized behaviour, components and parameters set and ready to go.
Presets have a white Icon to identify them.
Access a Preset - click to enlarge
If you need to make edits you can easily update your Presets.
To update a Preset open the Library, find the desired Preset, drag it into the scene and select it.
Make the desired changes. In the example below the total health of the Skeleton Warrior is reduced so it’s easier to defeat.
With the Object selected, click the Preset tool in the left toolbar.
When the preset window pops up, select the existing Preset and rename it.
Confirm the update by clicking Done.
Update a Preset - click to enlarge
All the changes, including the name of the Preset, will be updated in the Library and anywhere it has been used with an Asset Spawner or Drop Component.
Updating a Preset won't automatically update all the instances of the previous version in an experience. Use the Hierarchy to replace these with the new Preset.
If you update a Preset and want to apply those changes to an old version of it in your experience you can do so using the Hierarchy.
You can also use this process to replace an Object with a completely different Preset.
To replace an Object with a Preset open the Hierarchy by clicking the blue button
at the bottom of the left toolbar.
Then select the Object you want to replace from the Hierarchy list.
You can click on an Object in the viewport to highlight it in the Hierarchy.
Once selected, click on the hamburger menu next to the Objects name.
In the dropdown menu click Replace with Preset and then select the Preset you want to use from the pop-up window.
Replace with a Preset - click to enlarge
Once you click done your Object will be replaced by the chosen Preset.
You can also completely change a Preset with a new Object while preserving instances in which that Preset has been used to spawn an Asset.
Changing a Preset with a new Object won't keep the existing customisations.
Drag the Asset you want to use as a replacement into the scene and make adjustments to its Behaviours and Components as needed.
With the new Object selected, open the Preset tool and find the Preset you want to replace.
For this example, we'll replace the Skeleton Warrior Preset.
Give the Preset a new name and click done.
Change Preset Asset - click to enlarge
As soon as you've clicked done, the Presets new name, new Asset, and associated behaviour, components, and parameters, will be reflected in the Library and locations the previous Preset had been used with a spawner.
This will completely override the previous object and its customisations
You'll no longer have a backup in the Preset section of the Library.
If you don’t still have a version of the Preset you're replacing somewhere in your experience, you’ll need to redo the setup if you still wanted to use it.
If you do replace an existing Preset this way, consider making a duplicate before going ahead if you’re likely to use it in other areas of your experience.
If you’re certain you no longer need a Preset or end up with too many versions of a preset, you can declutter your list by deleting the ones you don't want.
Open your Library, find the desired Preset, right-click on it and choose Delete.
Delete a Preset - click to enlarge
Keep in mind that any behaviour or component currently using that Preset for a drop or spawn will no longer function as intended.
Presets can be used to customize Assets that only appear once they've been triggered in an experience.
When using the Asset Spawner or Drop Component without Presets you can only make a limited number of customizations.
For example, a Health Component can be added to the Asset to Spawn, but the variables, such as how much health that Object, can't be customized.
This problem is solved by using Presets because all of the customizations have already been saved and will be retained when used as the Asset to Spawn.
For example, perhaps we only want the Skeleton Warrior we created to appear once an Object has been destroyed.
To do this, we'll first drag the Asset we need into the scene, we'll use a Crate that the Skeleton Warrior will be hiding in.
First, we'll add the Health Component so the Object can be attacked and destroyed.
We'll then add the Drop Component, change the Type of Drop to Preset and select the Skeleton Warrior from the Preset pop-up window.
Spawn Preset - click to enlarge
Now when the crate is destroyed our customised Skeleton Warrior will spawn with all the variables we defined in the Preset, including the Drop Component for the collectable coin.
Once you've tried out the basics, you might start to notice that you can layer Presets on top of each other when they are used with Behaviours or Components that spawn them.
For example, the coin dropped by the Skeleton Warrior could be Preset, allowing further customisation than the default settings.
This would open up the opportunity to change its name, adjust the Collectable Component, and even try out something like the Bird Behaviour to achieve a floating motion once it’s spawned.
With the changes in place, we'll save the Preset by clicking the Preset tool, followed by Create New, and then giving it a name.
Creating a Coin Preset - click to enlarge
With the new Preset saved, we then need to place the Skeleton Warrior Preset in the scene so we can update the Drop Component with the new coin Preset.
With the Skeleton Warrior selected, change the Type of Drop in the Drop Component from Behaviour to Preset, and select the newly customised Magic Coin Preset.
Save the change by clicking the Preset tool, selecting the exisiting Preset, renaming it, and then clicking done.
Adding a Preset to a Drop Component - click to enlarge
The Skeleton Warrior Preset will now drop the Magic Coin Preset when defeated.
This change will also be reflected in any areas the Preset had been used with a spawner, so in this case, the Drop Component on the Crate will have these changes applied to it.
And yes, if you're following the same train of thought, the Crate can also be saved as a Preset by following the same steps.
Saving a Preset stacked with other Presets - click to enlarge
So now the Crate Preset spawns the Skeleton Warrior Preset and a Skeleton Warrior Preset spawns the Magic Coin Preset.
Since the Crate Preset is saved to the Library it can easily be dragged into the scene as many times as needed, and every instance will contain all of the customisations made so far.
The last tip in this list is that you can also save Hierarchy settings in a Preset.
This means if an Object is a Parent to other Objects, the Preset will retain those relationships.
When the Preset is placed in the scene any Objects that were Children to the Parent Object will also be placed in the scene and will maintain their orientation to the Parent.
To show how this works, we're going to take a desk Asset and customise it with a houseplant and a chair.
In case we want to move this arrangement, we're going to Parent them together so that both these objects move wherever the desk moves.
To do this make sure all your Objects are in the scene.
Then open the Hierarchy by clicking the blue button
at the bottom of the left toolbar.
With the Hierarchy window open find the Objects you want to use.
To Parent the houseplant and the chair to the desk, click, hold, and drag each Object, one at a time, onto the desk in the Hierarchy.
Parenting Objects - click to enlarge
Now if the desk moves, the plant and chair will move with it.
So that this setup can be used multiple times we just need to select the Parent asset, in this case, the desk, and then click the Preset tool and save it as a new Preset.
Now we can go to the Library the desk Preset can be dragged into the scene and it will include the other Objects parented to it, and they'll still move where the parent Object moves.
Create a Parent Preset - Click to Enlarge
This is a simple example, but this same principle can be used to achieve complex arrangements of objects, behaviours, components, and even messages.
For example, you could create a platform with a switch that toggles the movement of the platform.
You could then parent that switch to the platform so that even when the platform moves, the switch will move with it.
Parent Preset with Logic - Click to Enlarge
If you wanted to use this set up multiple times in your experience without needing to rebuild it every time, you could save it as a Preset, and then access it from the Library for easy placement.