Skip to main content

Exposed Parameters

Some asset types support so called exposed parameters. That means that an asset, such as a particle effect, a prefab or a script may provide parameters, that can be set through a corresponding component, such that each instance of the asset acts differently.

As an example, particle effects may expose a parameter that allows you to adjust their color. Now every time you add that particle effect to a scene, you can select the color for that particular instance, through the particle effect component. Similarly, scripts can expose parameters, which allow you to configure the starting conditions of the script.

Using exposed parameters to make an asset more versatile is usually less work and more efficient, than to build multiple variants of an asset.

Exposed Prefab Parameters​

In prefabs you can expose most types of properties of any component. When a prefab has any exposed parameters, they show up under Parameters in the Prefab Reference component of each instance:

Prefab Reference component of a placed prefab: the Prefab asset and the Parameters list, here with 0 parameters because this prefab exposes none

Each parameter has a reset arrow that sets it back to the prefab's value.

To expose a property inside a prefab as a parameter, open the prefab, hover over the property and open its … menu (Property actions), then choose Expose as Parameter:

Property actions menu of a light's Intensity property: Revert to Default, Copy Value, Paste Value, Copy Internal Property Name, Expose as Parameter and Remove Exposed Parameter

You will be asked under what name the property shall be exposed:

Parameter Name dialog with the name Intensity

This allows you to select a more meaningful name for the purpose of the parameter. You are also allowed to use the same name for multiple exposed parameters, which means that the user only sees one parameter, but it may be bound to multiple internal properties.

Every prefab document has a Prefab Settings panel next to Properties. Its Exposed Properties list shows every exposed parameter with its Name and Property Path:

Prefab Settings panel: Exposed Properties with one entry, Name Intensity and Property Path Intensity

Here you can remove or rename an exposed parameter. Remove Exposed Parameter in the property's … menu removes it as well.

Exposing Exposed Parameters​

It is perfectly valid to expose a property as a prefab parameter, which itself is already an exposed parameter from a nested prefab, a particle effect or a script.

Exposing Object References​

If a prefab contains an object that requires an object reference to operate on, you can expose the object reference, and thus allow users of your prefab to let each prefab instance operate on different objects.

See Also​