Classes
Every class available to OpalScript. Open a type for its methods and properties. Start from the high-level or low-level track; the Scripts chapter is the User Manual entry.
OpalScript
| Class | Description |
|---|---|
| Component | Base type for an OpalScript behavior attached to a scene object. |
| Entity | A live scene object. Missing, disabled, or destroyed references read as null. |
| Transform | This object's pose. Writes keep Motion targets in sync. |
| Scene | Find, spawn, and destroy entities in the current Play world. |
| Time | Gameplay clock, waits, and time groups for this Play world. |
| Game | Read and write declared GameState variables. |
| Debug | Write source-linked messages and assertions to the Console and browser developer tools. |
| Input | Read button, axis and vector actions configured in Settings → Project Input. |
| Camera | Convert between scene world coordinates and canvas screen pixels. |
| Audio | Play authored sound and music assets during Play. |
| UI | Read and write in-game UI elements by element id. |
| Network | Host-owned multiplayer requests, ownership, and sender context. |
| Definitions | Load immutable definition assets at runtime. |
| Math | Deterministic numeric helpers. Random is the only source of chance. |
| Vector2 | A 2D vector (X, Y). |
| Task | Owned asynchronous work. Compose with All and Race; cancel from the owner. |
| List | A mutable collection of at most 1,024 items. Assignment shares identity. |
| Map | An immutable string-keyed map of at most 1,024 keys. |
| Option | An explicit present or absent value. Guard HasValue before reading Value. |
| Subscription | A listener handle returned by Subscribe. Cancel unregisters the listener. |
| Event | A typed component event. Subscribe a handler or await its next payload. |
| Units | Typed quantities. Convert only through Units helpers or .Value. |
| Text | Bounded text trimming, case conversion and splitting. |
Native components
| Class | Description |
|---|---|
| AbilityCooldown | Gate an ability behind a cooldown. Tick counts down and emits ready when it hits zero. |
| AIMover | Drives a character controller (set to Controlled By: AI) to patrol, follow, or flee — no Flow wiring needed. |
| AudioEmitter | Owns one sound voice. Play, loop and stop it with volume, pitch and stereo pan. |
| Collider2D | Defines the collision shape for physics. Collider-only objects become fixed bodies (good for floors and walls). |
| Fluid2D | Experimental particle liquid. Emitters sharing this domain interact. Solid colliders contain the water; the object's rectangle is only its starting fill. |
| FluidDrain2D | Remove particles from a chosen domain inside this object's rectangle, including its rotation and scale. |
| FluidEmitter2D | Pour into an existing Fluid 2D domain. Nozzle width follows this object; velocity follows its local rotation. |
| FluidProbe2D | Observe water at a point on this object. Use wet/flow outputs and Entered, Exited or Splash events for swimming, pickups and water mechanics. |
| Health | Tracks HP, applies damage and healing, and emits damaged/died/healed events. |
| Inventory | Holds named items with stack counts. |
| Joint2D | Connects this object's rigid body to another with a hinge, weld, or distance joint. Both objects need Rigid Body 2D (and usually Collider 2D). |
| JointMotorController | Drive this object's hinge with keyboard, gamepad, or Flow. Use on a wheel, powered limb, or rotating mechanism. |
| Motion | Moves, tweens, springs, bounces, and smooths a Thing transform. |
| ParticleEmitter | Plays a looping particle effect on this object. Use Spawn VFX in Flow for one-shot bursts. |
| PlatformerController | Side-view locomotion with gravity, jumping, coyote time, and ground-aware foot probes. |
| ProximitySensor | Detects nearby objects in a radius or facing cone, with optional group, component and line-of-sight filters. Does not move or attack. |
| Ragdoll | Makes a skinned skeleton go limp using physics bones authored in Skeleton Studio. Activate on death or via action. |
| ResourceMeter | A named bounded numeric resource with exact spending and committed change results. |
| RigidBody2D | Simulates mass and velocity with Rapier 2D. Pair with Collider 2D so this object can hit and be hit. |
| SceneCamera | Named camera framing, tracking and simultaneous screen views, with editor preview guides. |
| SequenceQueue | Sequences object IDs without eligibility or victory rules. Duplicate IDs are distinct occurrences; Remove ends the active matching occurrence first, then removes the first pending occurrence. |
| SideScrollerController | Horizontal-focused movement (no gravity), with an optional vertical axis. Flips the sprite to face travel. |
| SoftBody2D | Deformable jelly and cloth with a textured mesh, spring connections, collisions, and pinned edges. Add directly to a sprite or shape, then choose a preset in the inspector. |
| Spawner | Spawns a prefab on an interval at this object's position. Great for enemy waves, obstacles, and pickups. |
| SpriteAnimator | Controls animation states, sprite sequences, and automatic locomotion animation. |
| SpriteRenderer | Draws an image-backed sprite and owns its source, tint, and render order. Flip and opacity actions update the host object's shared visual properties. |
| Stats | Attack, defense, and speed values with temporary modifiers. |
| Team | Tags this object with a team name (e.g. 'player', 'enemy'). |
| TopDownController | Free-plane movement in all directions, with optional diagonal and turn-to-face. |
| TransformConstraint | Copies selected parts of another object's world pose with offsets and optional smoothing, without changing hierarchy. Refuses pose-owner conflicts and dependency cycles. |
| ValueBar | Draws a world-space bar for any numeric field or computed getter, or a directly supplied value. |
Native types
| Class | Description |
|---|---|
| AbilityUse | Immutable result of AbilityCooldown.TryUse. |
| AudioPlaybackEvent | Owned sound playback transition. |
| CameraMoveEvent | Committed camera move, cancellation or shake event, measured in game milliseconds. |
| FluidContact | Immutable snapshot from a FluidProbe2D entered, exited or splash event. |
| FluidSample | Detached sample of committed liquid at one world point; does not expose particle arrays. |
| HealthChange | Immutable result of a Health command. HP commits before events drain. |
| HealthEvent | Immutable committed health event, shared by damaged, died and healed subscriptions. |
| InventoryChange | Immutable result of Inventory.Add and Inventory.Remove. |
| InventoryTransfer | Immutable result of Inventory.TransferTo. |
| ProximityNearestEvent | Committed nearest-object change. |
| ProximityTargetEvent | An object entered or exited the sensor's committed membership. |
| ResourceChange | Immutable result and committed event for a bounded numeric resource. |
| SequenceChange | Immutable result from a Sequence Queue command. |
| SequenceEmptyEvent | Committed Sequence Queue empty event. |
| SequenceItemEvent | Committed sequence item transition; repeated IDs are valid occurrences. |
| StatChange | Immutable result of Stats.SetBase, AddModifier, and related commands. |
| StatKind | Which combat stat Stats.Get, SetBase, and modifiers name. |