# new RezRelationship()
Represents a relationship between two game objects in the Rez game engine. Relationships are directional (source -> target) and can have attributes like strength, type, or other relationship-specific data. Each relationship automatically gets source_id and target_id attributes that reference the related objects.
Extends
Methods
# static constructor(id, attributes)
Creates a new relationship instance between two game objects
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string
|
unique identifier for this relationship (typically "rel_sourceId_targetId") |
attributes |
object
|
relationship attributes including source_id and target_id |
# static inverse() → {RezRelationship|null}
Gets the inverse relationship where the target and source are swapped. Since relationships are directional, the inverse represents the relationship in the opposite direction.
the inverse relationship (target -> source) or null if it doesn't exist
RezRelationship
|
null