# new RezGroup()
Represents a dynamically generated group of assets in the Rez game engine. Groups filter assets based on type, include_tags, and exclude_tags attributes. Provides methods for getting random assets from the filtered collection.
Extends
Methods
# static constructor(id, attributes)
Creates a new asset group instance
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string
|
unique identifier for this group |
attributes |
object
|
group attributes including type, include_tags, exclude_tags |
# static elementInitializer()
Initializes the group by filtering assets during game startup
# static filterAssets()
Filters all game assets based on type, include_tags, and exclude_tags to build the group's asset collection. The filtered assets are shuffled and stored.
# static randomAssetId() → {string}
Gets a random asset ID from this group, consuming it from the collection. If the group is empty, it will re-filter assets first.
if no matching assets are found
Error
ID of a random asset from this group
string