Skip to content

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 ​

ClassDescription
ComponentBase type for an OpalScript behavior attached to a scene object.
EntityA live scene object. Missing, disabled, or destroyed references read as null.
TransformThis object's pose. Writes keep Motion targets in sync.
SceneFind, spawn, and destroy entities in the current Play world.
TimeGameplay clock, waits, and time groups for this Play world.
GameRead and write declared GameState variables.
DebugWrite source-linked messages and assertions to the Console and browser developer tools.
InputRead button, axis and vector actions configured in Settings → Project Input.
CameraConvert between scene world coordinates and canvas screen pixels.
AudioPlay authored sound and music assets during Play.
UIRead and write in-game UI elements by element id.
NetworkHost-owned multiplayer requests, ownership, and sender context.
DefinitionsLoad immutable definition assets at runtime.
MathDeterministic numeric helpers. Random is the only source of chance.
Vector2A 2D vector (X, Y).
TaskOwned asynchronous work. Compose with All and Race; cancel from the owner.
ListA mutable collection of at most 1,024 items. Assignment shares identity.
MapAn immutable string-keyed map of at most 1,024 keys.
OptionAn explicit present or absent value. Guard HasValue before reading Value.
SubscriptionA listener handle returned by Subscribe. Cancel unregisters the listener.
EventA typed component event. Subscribe a handler or await its next payload.
UnitsTyped quantities. Convert only through Units helpers or .Value.
TextBounded text trimming, case conversion and splitting.

Native components ​

ClassDescription
AbilityCooldownGate an ability behind a cooldown. Tick counts down and emits ready when it hits zero.
AIMoverDrives a character controller (set to Controlled By: AI) to patrol, follow, or flee — no Flow wiring needed.
AudioEmitterOwns one sound voice. Play, loop and stop it with volume, pitch and stereo pan.
Collider2DDefines the collision shape for physics. Collider-only objects become fixed bodies (good for floors and walls).
Fluid2DExperimental particle liquid. Emitters sharing this domain interact. Solid colliders contain the water; the object's rectangle is only its starting fill.
FluidDrain2DRemove particles from a chosen domain inside this object's rectangle, including its rotation and scale.
FluidEmitter2DPour into an existing Fluid 2D domain. Nozzle width follows this object; velocity follows its local rotation.
FluidProbe2DObserve water at a point on this object. Use wet/flow outputs and Entered, Exited or Splash events for swimming, pickups and water mechanics.
HealthTracks HP, applies damage and healing, and emits damaged/died/healed events.
InventoryHolds named items with stack counts.
Joint2DConnects this object's rigid body to another with a hinge, weld, or distance joint. Both objects need Rigid Body 2D (and usually Collider 2D).
JointMotorControllerDrive this object's hinge with keyboard, gamepad, or Flow. Use on a wheel, powered limb, or rotating mechanism.
MotionMoves, tweens, springs, bounces, and smooths a Thing transform.
ParticleEmitterPlays a looping particle effect on this object. Use Spawn VFX in Flow for one-shot bursts.
PlatformerControllerSide-view locomotion with gravity, jumping, coyote time, and ground-aware foot probes.
ProximitySensorDetects nearby objects in a radius or facing cone, with optional group, component and line-of-sight filters. Does not move or attack.
RagdollMakes a skinned skeleton go limp using physics bones authored in Skeleton Studio. Activate on death or via action.
ResourceMeterA named bounded numeric resource with exact spending and committed change results.
RigidBody2DSimulates mass and velocity with Rapier 2D. Pair with Collider 2D so this object can hit and be hit.
SceneCameraNamed camera framing, tracking and simultaneous screen views, with editor preview guides.
SequenceQueueSequences 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.
SideScrollerControllerHorizontal-focused movement (no gravity), with an optional vertical axis. Flips the sprite to face travel.
SoftBody2DDeformable 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.
SpawnerSpawns a prefab on an interval at this object's position. Great for enemy waves, obstacles, and pickups.
SpriteAnimatorControls animation states, sprite sequences, and automatic locomotion animation.
SpriteRendererDraws an image-backed sprite and owns its source, tint, and render order. Flip and opacity actions update the host object's shared visual properties.
StatsAttack, defense, and speed values with temporary modifiers.
TeamTags this object with a team name (e.g. 'player', 'enemy').
TopDownControllerFree-plane movement in all directions, with optional diagonal and turn-to-face.
TransformConstraintCopies selected parts of another object's world pose with offsets and optional smoothing, without changing hierarchy. Refuses pose-owner conflicts and dependency cycles.
ValueBarDraws a world-space bar for any numeric field or computed getter, or a directly supplied value.

Native types ​

ClassDescription
AbilityUseImmutable result of AbilityCooldown.TryUse.
AudioPlaybackEventOwned sound playback transition.
CameraMoveEventCommitted camera move, cancellation or shake event, measured in game milliseconds.
FluidContactImmutable snapshot from a FluidProbe2D entered, exited or splash event.
FluidSampleDetached sample of committed liquid at one world point; does not expose particle arrays.
HealthChangeImmutable result of a Health command. HP commits before events drain.
HealthEventImmutable committed health event, shared by damaged, died and healed subscriptions.
InventoryChangeImmutable result of Inventory.Add and Inventory.Remove.
InventoryTransferImmutable result of Inventory.TransferTo.
ProximityNearestEventCommitted nearest-object change.
ProximityTargetEventAn object entered or exited the sensor's committed membership.
ResourceChangeImmutable result and committed event for a bounded numeric resource.
SequenceChangeImmutable result from a Sequence Queue command.
SequenceEmptyEventCommitted Sequence Queue empty event.
SequenceItemEventCommitted sequence item transition; repeated IDs are valid occurrences.
StatChangeImmutable result of Stats.SetBase, AddModifier, and related commands.
StatKindWhich combat stat Stats.Get, SetBase, and modifiers name.