Constructor
# new RezObject()
A generic game object for author-defined data structures.
RezObject provides a way for authors to define custom object types that don't fit into the predefined categories (actors, items, scenes, etc.). Authors can store any attributes they need and use the object from their own scripted functions or behaviours.
This is useful for:
- Custom game mechanics not covered by built-in types
- Data containers for complex game state
- Grouping related configuration values
- Prototyping new object types before formalizing them
Define in Rez:
@object weather_system {
current_weather: "sunny"
temperature: 72
wind_speed: 5
}
Example
Access at runtime
const weather = $("weather_system");
weather.temperature = 65;
weather.current_weather = "rainy";
Extends
Methods
# static constructor(id, attributes)
Creates a new RezObject.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string
|
Unique identifier for this object |
attributes |
Object
|
Initial attribute values |