Decoration class represents a purely visual object placed on a side in a RollingQuest level. Decorations do not affect gameplay — they have no collision or item logic — but they can be toggled on and off via script to create visual effects, reveal hidden scenery, or synchronise animations with level events. Scripts attached to a decoration receive it as self, and you can also retrieve decorations from a side via side.decoration or by iterating a section’s decorations.
Properties
Identity
| Property | Type | Read-only | Description |
|---|---|---|---|
type | EntityType | ✅ | Always EntityType.Decoration (6). |
name | string | ✅ | Name of the decoration template. |
tag | string | ✅ | Tag used for grouping and scripted lookup. |
Transform
| Property | Type | Read-only | Description |
|---|---|---|---|
position | Vector3 | ✅ | World-space position of the decoration. |
rotation | Quaternion | ✅ | World-space rotation of the decoration. |
basis | Basis | ✅ | Local coordinate-system basis of the decoration. |
slot | BlockSlot | ✅ | Grid slot of the block the decoration is attached to. |
section | string | ✅ | ID of the level section containing the decoration. |
State
| Property | Type | Read-only | Description |
|---|---|---|---|
isEnabled | boolean | ✅ | true while the decoration is visible in the scene. |
properties | ElementPropertyPool | ✅ | Custom property pool attached to the decoration. |
localData | RawLocalData | ✅ | Per-instance local data store for this decoration. |
Methods
enable / disable
enable() to restore it.
Type-cast helpers
Use these to narrow a generic entity reference to a concrete type. Each throws an error if the cast is invalid.DecorationData
DecorationData is the mutable representation used when constructing or modifying level data (e.g. in OnLevelLoad). It exposes the following fields:
| Property | Type | Read-only | Description |
|---|---|---|---|
orientation | Orientation | ❌ | The initial facing orientation of the decoration. |
template | string | ❌ | Template identifier that selects the decoration’s appearance. |
scriptRef | string | ❌ | Script file reference attached to the decoration. |
scriptTag | string | ❌ | Tag forwarded to the decoration’s script. |
scriptVars | ScriptVariables | ✅ | Variable table passed to the decoration’s script. |
properties | ElementPropertiesData | ✅ | Design-time property data. |
clear() to reset a DecorationData instance to empty defaults.
Usage Example
The following example shows a side script that hides all decorations tagged"hidden_deco" when the ball first rolls onto the side, then reveals them again after a two-second delay: