Item class represents any collectible object placed on a side in a RollingQuest level. Scripts attached to an item receive it as self in hooks such as OnCollect and OnRespawn. You can read the item’s state, programmatically collect it for any ball, and toggle its presence in the level. RollingQuest ships with a large library of typed item sub-classes — from simple collectibles like ItemCoin to gameplay modifiers like ItemSlowMotion — all inheriting the properties and methods described here.
Properties
Identity
Transform
State
Methods
collect
enable / disable
Type-cast helpers
Use these when you hold a generic entity reference and need to narrow its type. Each throws an error if the cast is invalid.ItemData
ItemData is the raw, mutable representation used when building level data (e.g. in OnLevelLoad). It exposes template, scriptRef, scriptTag, scriptVars, and properties as writable fields, plus isRespawnEnabled and respawnTime which control whether the item reappears after being collected. Call clear() to reset it to defaults.
Item Subtypes
All of the following sub-classes inherit every property and method fromItem. You receive the most specific type automatically when accessing items at runtime.
Custom Events
MostItem sub-classes don’t emit custom events. The exception is ItemPortalEntrance, which fires when the portal teleports a ball. Listen for it with the OnCustomEvent hook.
Usage Example
TheOnCollect hook fires when a ball collects the item. The example below logs the collector’s name and disables the item for 5 seconds before re-enabling it: