GameObject Add Data
Add a Data Component to a GameObject, or reuse an existing matching component.
Parameters
| Parameter | Description |
|---|---|
| Game Object | The GameObject to add or find data on. |
| Data Definition | The schema used to identify or create the Data Component. |
| Component | Stores the DataRecordComponent that was found or added. |
| Added | True if a new component was added. |
| Succeeded | True if a matching component now exists. |
Details
This action finds an existing Data Component with the selected Data Definition. If none is found, it adds one and applies schema/default values.
Examples
- Ensure an enemy has runtime stats data before combat starts.
- Add quest-state data to an NPC when it first spawns.