Behavior
The Behavior component is a key part of our smart assets that defines their gameplay behaviors. Similar to the Transform component, Behavior is inherent to smart assets and cannot be added or removed. It allows for faster customization of gameplay attributes and models. You can also review events, conditions, and actions to enable better interaction with game logic.
When a smart asset has the Behavior component, a "Smart" label appears next to its name in the Scene Explorer and within the Behavior component itself in the Properties window.
In the Scene Explorer:
In the Properties window:
In the Properties window, you can adjust the smart asset's basic attributes, model list, event list, condition list, and action list.
Basic attributes
Modify smart asset attributes in the Behavior component to define in-game behavior. For example, with the Unlocked Door smart asset, relevant attributes include interaction distance, close door time, handle rotation time, etc.
Model List
Expanding the Model List shows all available models of the smart asset that can be directly swapped. In the case of an unlocked door, there are two handles, the door body, and the door frame.
Hovering over a model dropdown list reveals a Zoom to object icon. Next to each model, you'll find a Show gizmo icon and an Edit icon.
Clicking the Zoom to object icon will highlight the model in the scene.
Clicking the Show Gizmo icon will highlight the original position of the selected model. By default, when you change a model from the Model List, its original position will be marked in red in the scene to assist with adjustments. This highlight will automatically update when you replace any other model within the Model List, such as switching between Door body and Door frame, or when you select a different object.
The Edit icon allows you to adjust the detailed properties of the model.
To replace a model, expand the model dropdown list and choose a model in the scene or select More models for more options.
The Choose Model window offers two tabs:
- Similar: Look-alike models
- Assets: Added assets from Asset Library
If you want to use your own custom model, import it to Studio and add it to the scene so you can select it directly from the expandable list.
Event, Condition, and Action Lists
Following the Model List are three reviewable lists:
- Event List: Displays all events that work as an if statement
- Condition List: Displays all conditions (except for smart assets with no associated conditions)
- Action List: Lists all the smart asset's actions, which can be previewed by clicking the Preview button next to them. After previewing, click Exit Preview to stop and continue editing.
These lists can be used together with an Event Trigger component to make the smart asset work when triggered.
- A Condition List may not be included if the smart asset has no associated conditions.
- Previewing actions may not be available for some smart assets despite the presence of the Preview button.
Example: Swapping models and previewing actions
Let's demonstrate how to swap models and preview the actions to ensure the desired effects:
- Change the door body from the default [Model]Object_door_common_1(1) to a white model named Door.
- Change the door frame from the default [Model]Object_doorframe_Common_1(1) to DoorArc.
- Adjust the positions of all models to ensure they fit together properly. You can also use the Show gizmo icon to help with position adjustment.
- Then click the Preview button next to each action to verify its functionality.
Before:
After:
To stop the action preview, click Exit Preview.
To gain comprehensive control over the smart asset, navigate to the Scene Explorer. Expand the smart asset to view and edit all of its child objects, including audio settings, triggers, and more.
For a list of smart assets containing the Behavior component, see Extension packages.