Skip to content

Built-in component reference ​

Component IDs are stable across scenes and blueprints — the engine persists them by ID, so existing scenes keep working as fields evolve.

This page is the inspector and Flow catalog: fields, actions, conditions, and events. Native components also have an OpalScript class — Health, RigidBody2D, Motion, and the rest — listed in the Scripting API.

Each component below lists its fields, actions (callable from Flow), conditions (checkable from Flow), events (Flow graph triggers), lifecycle hooks, and any cross-component dependencies. Fields marked hidden are internal and don't show in the inspector or Flow; fields marked output are read-only at runtime (engine-set state).

Legacy components: stats, combatAction, turnQueue, and networkHit are deprecated for new attachments. Existing scenes, prefabs, scripts, Flow nodes, and exports keep their IDs and behavior. Their Inspector cards explain the replacement path. New RPG stats, damage formulas, turn eligibility and victory rules belong in project Behavior Components. Use Network Input for new authorized tap/key commands. Deprecation does not automatically convert saved content or remove runtime support.

Browsing components in the editor

The Object Flow node picker lists every registered component — built-ins plus your script-authored Behavior Components — grouped and sorted so attached ones float to the top.


Project-specific possession, victory, death and cover-timing recipes are documented in Project gameplay policies.

Core ​

These components are on almost every object: rendering an image, moving it, and catching taps and drags.

Motion (motion) ​

Category: Core Description: Moves, tweens, springs, bounces, and smooths a Thing's transform.

Fields ​

FieldTypeDefaultNotes
springStiffnessnumber0.180–1; spring follow stiffness
springDampingnumber0.680–1; spring follow damping
dragStiffnessnumber0.520–1; stiffness while being dragged
dragDampingnumber0.580–1; damping while being dragged
scaleSmoothingnumber100 disables smoothing
rotationSmoothingnumber80 disables smoothing

Actions ​

ActionParamsBehavior
Move Tox, y, durationMs, easingTween position to (x, y) over durationMs.
Snap Tox, yInstantly set position; cancels any move tween.
Scale Tovalue, durationMs, easingTween scale to value.
Rotate Tovalue, durationMs, easingTween rotation to value.
Cancel Tweens—Stop all tweens; snap targets to current.
Reset Home—Return position/scale/rotation to home.
BounceamountScale-bounce effect sized by amount.
ShakedurationMs, intensityShake by oscillating scale/rotation with decay.

Easing values: easeOutQuad (default), easeInQuad, easeInOutQuad, easeOutBack, easeOutBounce, linear.

Conditions ​

ConditionTrue when
isMovingA move tween is active.
isAnimatingAny tween or bounce is active.

Events ​

EventPayload
Move Completex, y
Scale Completevalue
Rotation Completevalue
Shake CompletedurationMs, intensity

Lifecycle ​

  • onTick: Steps tweens, applies springs in fixed 1/60-second substeps (up to 60 per tick), runs shake/bounce, emits completion events. Authored stiffness/damping retain their 60 Hz meaning; frames above 60 Hz may wait one substep.
  • onPlayStart / onPlayEnd / onDetach: Reset motion runtime state.

::: note When something is being dragged While thing.dragging is true, move tweens cancel and Motion swaps to dragStiffness/dragDamping. The Draggable component (and engine) sets that flag — you don't wire it. :::


Sprite Renderer (spriteRenderer) ​

Category: Core Description: Draws an image-backed sprite and controls render order, tint, source, flip, and opacity.

The Sprite field selects an image asset from the library. Most source metadata fields are kind: internal — they persist and serialize but are managed by the engine and the Studio actions below, so they're hidden from the inspector and Flow.

Fields (selected) ​

FieldTypeDefaultNotes
renderOrderint0Position inside the nearest Sorting Group.
tintcolor#ffffffFlat overlay color.
tintAmountnumber0Overlay strength (0 = off, 1 = solid).
assetSrcstring""hidden; resolved image source.
assetLibraryIdassetRef""Sprite image selected from the asset library.

Actions ​

ActionParamsBehavior
Appearstyle (fade/pop/scale), durationMs, delayMsShow sprite with an entrance animation.
Vanishstyle (fade/shrink), durationMs, delayMs, hide, markDoneFade/shrink out; optionally hide and/or mark done.
CollectdurationMsShrink + fade out, hide, mark done.
Set SpriteassetId, preserveSizeSwap sprite image to a library asset.
Set Flipflipped (Flip X), flipYMirror the sprite horizontally and/or vertically.
Set Alphavalue (0–1)Set sprite opacity.
Set Tintcolor, amount (0–1)Overlay a flat tint color on the sprite.

Conditions ​

ConditionTrue when
Has SpriteassetSrc or assetLibraryId is set.
Sprite Iscurrent sprite matches a given asset.
Is AnimatingAn appear/vanish tween is active.

Events ​

EventPayload
Appear Completestyle
Vanish Completestyle, hidden

Lifecycle ​

  • onAttach: Reloads with asset resolution.
  • onPlayStart: Initialises anim state, records home alpha/scale.
  • onTick: Steps appear/vanish tweens.

Sprite Animator (spriteAnimator) ​

Category: Core Description: Controls named animation states, sprite sequences, and automatic locomotion animation. Requires Sprite Renderer.

Fields (selected) ​

FieldTypeDefaultNotes
activeStatestring"idle"hidden; current Animation State.
stateSpritesobject{}hidden; Animation State name → sprite source.
stateSequencesobject{}hidden; Animation State name → sprite frames.
autoLocomotionStatesbooleanfalseAutomatically select locomotion states from a character controller.
idleState/walkState/runState/jumpState/fallState/landingStatestring"idle"…hidden; locomotion role → Animation State name.
landingStateDurationMsnumber150How long the Landing State is held after touching down.

Actions ​

ActionParamsBehavior
Configure Locomotion Statesidle/walk/jump/fall/landing/run sprites and sequencesAssign locomotion sprites and looping sequences.
Play Animationsequence, loop, restorePlay a sprite animation; a one-shot may restore the prior state frame.
Set Idle/Walk/Run/Jump/Fall/Landing Statesprite, sequence, autoApplyBind a locomotion state's sprite or animation.
Set Locomotion StateroleSwitch to an authored locomotion state.
Set Automatic Locomotion StatesenabledToggle controller-driven locomotion states.
Set Animation StatestateSwitch to a named Animation State.

Conditions ​

Animation State Is, Locomotion State Is.

Events ​

EventPayload
State ChangedoldValue, newValue
Locomotion States Readycount, role
Animation Completename

::: note Automatic locomotion states When enabled, Sprite Animator reads an attached character controller to select Idle, Walk, Run, Jump, Fall, and Landing states without extra Flow wiring. :::


Shape 2D (shape2d) ​

Category: Rendering Description: Editable geometry for floors, walls and ramps. Its visible outline, selection and automatic collision use the same shape, including after resizing or flipping. Create these objects with Arrange → Shapes and adjust them with Edit points on stage in the inspector.

Fields ​

FieldTypeDefaultNotes
shapeenumrectangleRectangle, Ramp, or convex Polygon
fillColorcolor#718096Visible fill color
collisionEnabledbooleantrueSolid geometry; disable for decoration
frictionnumber0.7Surface grip; zero is slippery
restitutionnumber0Bounce, from zero to one

Without Rigid Body 2D the shape is fixed, suitable for level geometry. Add Rigid Body 2D for dynamic geometry. An enabled Collider 2D overrides automatic shape collision; an enabled Soft Body 2D owns collision. The inspector explains these overrides. Shape 2D exposes Collision Start and Collision End events.

Polygon points are saved with the component. Polygons support up to 64 points and must be convex, with no crossing edges or duplicate points. Use multiple shapes for inward corners. Shape geometry exports directly; no image asset is required. Extremely thin outlines stay visible but have no automatic collision; the inspector identifies these outlines so you can widen them for stable physics.


Sorting Group (sortingGroup) ​

Category: Core Description: Keeps this object and its visual descendants together in paint order so a character or prop doesn't interleave with unrelated sprites.

Fields ​

FieldTypeDefaultNotes
renderOrderint0Positions the whole group relative to neighboring renderers and groups

Sprite Renderer renderOrder is relative to the nearest Sorting Group ancestor.


Interactable (interactable) ​

Category: Core Description: Lets an object receive taps/clicks: its hit region, built-in tap action, and whether it blocks taps to objects behind it. This is the modern tap component — it's auto-added when you wire an "On Tap" graph.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueOff = ignores taps
hitAreaenum"sprite"sprite (opaque pixels), bounds (full rectangle), collider (collider shape)
blocksBehindbooleantrueOff lets taps pass through to objects behind
tapActionenum"none"none, bounce, sparkle, sound, spin, collect, toggle
tapOnlybooleanfalseOn draggable objects, register a quick tap instead of a drag
longPressbooleantrueEmit Long Pressed
doubleTapbooleantrueEmit Double Tapped

Actions ​

ActionParamsBehavior
Set Tap Actionaction (enum)Set the built-in tap reaction.
Clear Tap Action—Set tapAction to none.
Set TappableenabledEnable/disable tap reception.

Conditions ​

ConditionTrue when
Is Tappableenabled is not false.
hasActiontapAction is not none.
Action IstapAction matches a given value.

Events ​

EventPayload
Tappedpointer
Double Tappedpointer
Long Pressedpointer

Draggable (draggable) ​

Category: Core Description: Lets an object be dragged, axis-constrained, and dropped onto Drop Zones.

Fields ​

FieldTypeDefaultNotes
axisenum"free"free, x, y
boundsenum"none"none, stage
moveThresholdnumber6Pixels the pointer must travel before a drag starts
pickUpScalenumber1.12Scale while held

Actions ​

ActionParamsBehavior
Set Drag Axisaxis (free/x/y)Constrain dragging axis.
Set Drag Boundsbounds (none/stage)Set stage bounds.
Set Pick-up ScalevalueSet scale while held.

Conditions ​

ConditionTrue when
isDraggingthing.dragging is truthy.
constrainedToStagebounds is stage.
Axis Isaxis matches.

Events ​

EventPayload
Drag Startedpointer
Drag Movedpointer, deltaX, deltaY
Drag Endedpointer
DroppedotherId, targetId, dropX, dropY

::: note Drop Zones resolve targets The Dropped event carries otherId/targetId resolved from nearby Drop Zones. The engine sets thing.dragging, which Motion reads to switch to drag tuning — no wiring required. :::


Drop Zone (dropZone) ​

Category: Core Description: Marks an object as a target area for drops and proximity checks.

Fields ​

FieldTypeDefaultNotes
radiusnumber110Proximity threshold in pixels

Actions ​

ActionParamsBehavior
Set RadiusvalueSet the zone radius.

Conditions ​

ConditionTrue when
hasRadiusradius > 0
Radius At Leastradius ≥ value

Events ​

EventPayload
EnteredotherId, pointer
ExitedotherId, pointer
Dropped OnotherId, droppedId, dropX, dropY

Rendering ​

These components expose the modern Render2D lighting path without putting GPU, Canvas, texture, or render-target handles into a project. Add a Light 2D to any object and a Sprite Material 2D to the sprites that should receive it.

Scene Render (sceneRender) ​

Category: Rendering Description: Opts the scene camera into HDR lighting. Bright sprite, mesh and particle values remain above white until bloom is combined and the scene is tone mapped. Ordinary Canvas hooks are composited in order. The game HUD and speech render afterward.

Fields ​

FieldTypeDefaultPurpose
enabledbooleantrueEnable the scene rendering settings.
hdrbooleantruePreserve bright scene values on supported WebGL2 devices, including when bloom intensity is zero.
exposurenumber0Final scene exposure in stops, −8–8, while HDR is active.
toneMappingenum"aces"Map combined HDR scene light and bloom to the display: none, reinhard, or aces.

The active camera takes priority. Games without this component keep their previous rendering. Canvas2D, unsupported devices, and unsafe Canvas operations (including destination-dependent blends, readbacks, self-copy, clips and unknown raw draw callbacks) use standard rendering; fallback counters explain why. Disabling HDR or taking this fallback skips the camera's exposure and tone mapping. Leave per-sprite tone mapping at none when the camera owns the final tone map.

Play controls and exported player controls offer Auto, High, Balanced and Low quality. These change backing resolution, light-field density, bloom processing resolution and shadow-mask size without changing any saved component settings. Auto responds to sustained timing pressure with hysteresis.

Scene Bloom (sceneBloom) ​

Category: Rendering

Description: Adds soft glow around bright scene pixels during Play. Attach to the scene camera. Sprites, deforming meshes, and particles contribute; native HUD elements and speech stay sharp. The effect also ships in exported players. With Scene Render it extracts glow from the retained HDR scene. Otherwise it uses a bounded copy of the displayed scene. Both paths include mixed Canvas and WebGL content.

Fields ​

FieldTypeDefaultPurpose
intensitynumber0.65Glow strength, 0–3. Zero skips capture and bloom passes.
thresholdnumber0.78Brightness cutoff, 0–16. Values above 1 isolate HDR lighting and emission; lower values make more of the scene glow.
radiusnumber1.5Halo softness at the processing resolution, 0–8.
downsamplenumber4Resolution divisor, 1–8. Larger values spread glow and reduce cost. Standard scene captures cap the longer dimension at 512 pixels; HDR processing accounts for display scale.

Disable the component to retain its settings without drawing bloom. If several objects have enabled bloom components, the active camera takes priority and otherwise the first enabled component with positive intensity is used.

Light 2D (light2d) ​

Category: Rendering Description: Emits a colored, range-limited local light to Sprite Material 2D receivers on the same lighting layer.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueWhether this component emits light.
layerstring"default"Matches any comma-separated receiver layer case-insensitively; * matches all.
colorcolor#ffffffColor encoded in the light contribution texture.
intensitynumber1Diffuse energy, 0–8. Values above 1 are preserved in HDR light targets.
rangenumber320World-space radius in pixels.
heightnumber180Virtual distance above the 2D surface; larger values make lighting more frontal.
falloffnumber2Radial attenuation exponent, 0.25–8.

Actions ​

ActionParamsBehavior
Set Light EnabledenabledStart or stop emitting without losing tuning.
Set Light IntensityvalueSet diffuse energy from 0–8.
Set Light ColorcolorChange color and rebuild the shared procedural light texture.

Conditions ​

Light Is Enabled is true when the authored switch is on and intensity is greater than zero.

Lifecycle ​

  • onAttach / onFieldsChanged: Lazily builds or refreshes a small procedural attenuation texture in runtime state.
  • onEditorDraw: Shows the light center and world-space range as an editor-only gizmo.

Light Occluder 2D (lightOccluder2d) ​

Category: Rendering Description: Blocks local lights using this object's rectangular bounds. Resize, rotate, parent or move the object to shape its hard shadow. Each light keeps an independent mask, so an unblocked lamp still illuminates the shadow.

Fields ​

FieldTypeDefaultPurpose
enabledbooleantrueWhether this rectangle blocks light.
layerstring"default"Blocks lights sharing any comma-separated layer; * matches all lights.

Actions ​

ActionParamsBehavior
Set Occluder EnabledenabledEnable or disable blocking.

Conditions ​

Blocks Light reports the authored switch. Hidden or disabled objects do not block light. A lamp ignores its own rectangle; a lamp inside another blocker is fully blocked. Masks are shared across receivers and released when unused, with bounded light and occluder counts.

Sprite Material 2D (spriteMaterial2d) ​

Category: Rendering Description: Adds portable normal-mapped lighting, emission and color grading to an image-backed Sprite Renderer, including deforming soft-body meshes. Requires Sprite Renderer.

Flat receivers automatically use the scalable shared-field path. WebGL2 shades them directly in the normal sprite draw. Directional materials shade directly on WebGL2 with a bounded Canvas2D reference path. This runtime optimization does not change serialized component data.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueReceive matching lights; off restores the ordinary sprite fast path.
normalMapassetRef""Optional tangent-space image. Empty uses a generated flat normal.
layerstring"default"Receives Light 2D components sharing any comma-separated, case-insensitive layer; * matches all.
ambientnumber0.22Baseline light contribution, 0–4.
emissionColorcolor#ffffffGlow color, masked by the artwork's alpha.
emissionIntensitynumber0Emitted light, 0–16, including without lamps. Values above 1 contribute strong HDR bloom.
normalStrengthnumber1Scales normal-map detail, 0–4.
maxLightsint4Highest-impact intersecting lights sampled by the directional per-sprite path, 1–4. Shared fields accumulate all matching lights.
lightingScopeenum"auto"auto shares flat surfaces and keeps normal maps directional; layer forces the shared field; sprite forces per-sprite lighting.
smoothingbooleantrueUse linear sampling for the final lit target.
exposurenumber0Color-grading exposure in stops, −8–8.
contrastnumber1Post-lighting contrast, 0–4.
saturationnumber1Post-lighting saturation, 0–4.
vignettenumber0Edge darkening, 0–1.
toneMappingenum"none"none, reinhard, or aces.

Actions ​

ActionParamsBehavior
Set Normal MapassetIdSwap or clear the stable normal-map asset reference.
Set Receiving LightingenabledEnter or leave the authored material path.

Conditions ​

Receives Lighting reports the authored receive switch. Has Normal Map reports whether an asset or inline source is configured; a flat normal remains available when it is false.

Lifecycle ​

  • onAttach / onRuntimeContextChanged: Resolves the stable normal-map asset id into runtime-only decoded image state.
  • onFieldsChanged: Invalidates and reloads the decoded normal when the asset changes.

On WebGL2, flat surfaces automatically share one stage-space HDR field per receiver-layer mask. Every matching light is accumulated once, and each sprite samples its transformed world region without a per-sprite light ceiling. Normal-mapped or explicitly sprite-scoped materials select up to maxLights by layer, range, and impact for directional lighting. If no matching light is active, no targets are submitted and the existing one-command sprite path is retained. Canvas2D keeps the bounded per-sprite path as its reference fallback.

Particle Emitter (particleEmitter) ​

Category: Rendering Description: Plays a looping particle effect on this object. Use Flow Spawn VFX for one-shot bursts. The Particle Canvas (FX workspace) bakes .pfx assets this component can play.

Fields ​

FieldTypeDefaultNotes
effectassetRef""Baked .pfx or a builtin name (sparkle, smoke, fire, …). assetKind: particle.
autoPlaybooleantrueStart the effect when play begins.
loopbooleantrueKeep emitting. Off plays one burst then stops.
offsetXnumber0Horizontal offset from this object.
offsetYnumber0Vertical offset from this object.
seedint1Seeded RNG for this instance.
playingbooleanfalseoutput — true while an effect instance is live.

Actions ​

ActionParamsBehavior
Play—Start (or restart) the effect.
Stop—Stop the effect.
Restart—Stop and play again from this object's position.

Conditions ​

Is Playing is true while an effect instance is live.

Events ​

EventPayload
Startedeffect
Stoppedeffect

Lifecycle ​

  • onPlayStart: Starts the effect when autoPlay is on.
  • onRuntimeContextChanged: Retries start if vfx was missing at attach (session-scoped, not ambient).
  • onTick: Follows the host via vfx.setOrigin.
  • onPlayEnd / onDetach: Stops the instance.

Control ​

Character controllers drive locomotion. The engine is shared (character-controller-core.js); three flavors expose it with different movement models. Set controlledBy to player, flow, ai, or network to choose who drives it.

Joint Motor Controller (jointMotorController) ​

Category: Control · Requires: Joint 2D

Drives the same object's revolute hinge using player input or game logic. Add it from Joint 2D → Add drive controls; Physics Cart includes it on Rear Wheel.

Fields ​

FieldTypeDefaultNotes
controlledByenumplayerPlayer or Flow / Script
speednumber-5Forward angular speed in rad/s; flip sign to change direction
forcenumber100000Motor strength; tune for body size and density
idleenumcoastRelease the motor or brake at zero input
reverseInputbindingArrowLeftRemappable reverse input
forwardInputbindingArrowRightRemappable forward input
brakeInputbindingSpaceHold to brake; overrides driving
adKeysbooleantrueAlso accept A/D
gamepadbooleantrueAlso accept analog left-stick X with the shared deadzone

Actions and lifecycle ​

Set Drive (value) accepts -1 to 1 while Controlled By is Flow / Script; the value stays active until changed and resets on Play. OpalScript: GetComponent<JointMotorController>().SetDrive(0.5). Disabling or removing the controller restores the joint's previous motor settings. Disabling or breaking its Joint 2D stops control. This controller does not move transforms directly; the connected bodies remain part of the ordinary physics world.

Platformer Controller (platformerController) ​

Category: Control Description: Side-view locomotion with gravity, jumping, coyote time, jump buffering, and ground-aware foot probes.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
controlledByenum"player"player, flow, ai, network
maxSpeednumber220px/s
accelerationnumber900px/s²
frictionnumber1200px/s²
airAccelerationnumber700px/s²
airFrictionnumber160px/s²
gravitynumber1800px/s²
terminalVelocitynumber1400px/s
jumpSpeednumber620px/s
maxJumpsint12 = double jump
variableJumpHeightbooleantrueCut upward velocity when jump released early
variableJumpMinPercentnumber0.4Fraction of full jump retained
coyoteTimenumber0.08Seconds after leaving ground a jump still works
jumpBufferTimenumber0.08Seconds a queued jump waits before landing
useStageFloorbooleantrueLand on the bottom of the stage
floorYnumber0Custom floor Y when useStageFloor is off
collideWithWorldbooleanfalseUse physics colliders
clampToStagebooleanfalseKeep inside the stage
arrivalRadiusnumber8px to count as "arrived" for Move Toward
footProbe*——Foot probing: showFootProbes, footProbeSpread, footProbeInset, footProbeLeftX/RightX, footProbeDepth, footProbeLift, footProbeYOffset, footProbeMode (leading/…), footProbeSpeed
rotateSpritebooleanfalseFlip sprite horizontally to face movement
jumpKeybinding"Space"Click the field and press any key, mouse button, or gamepad button.
leftKey/rightKey/upKey/downKeybindingArrow keysClick the field and press any key, mouse button, or gamepad button.
wasdbooleantrueAlso accept WASD
movingbooleanfalseoutput
facingenum"right"output; 8-directional
grounded / jumping / fallingbooleanfalseoutput

Actions ​

ActionParamsBehavior
Set Move Inputx, ySet persistent movement intent.
Move Directionx, ySet movement direction intent.
Move Towardx, y, stopWithinMove toward a point; emits Arrived on arrival.
Clear Move Target—Clear the move-to target.
StophaltVelocityStop; optionally halt velocity.
Set SpeedvalueSet maxSpeed.
Set Controller EnabledenabledEnable/disable.
Set Facing / Face Directiondirection / x, ySet facing.
JumpstrengthQueue a jump.

Conditions ​

ConditionTrue when
Can Moveenabled is true.
Is Moving / Is Idlemoving is true / false.
Has Move TargetA move-to target exists.
Facing Isfacing matches.
Is Grounded / Is Airbornegrounded is true / false.
Is Fallingfalling is true.
Can JumpEnabled and has a ground jump or remaining jumps.

Events ​

EventPayload
Move Started / Move Stoppedx, y, vx, vy, speed
Direction Changed / Facing Changeddirection, x, y
Arrivedx, y
Jumpedx, y, vx, vy, jumpsUsed
Landed / Left Groundx, y, vx, vy

Top-Down Controller (topDownController) ​

Category: Control Description: Free-plane movement in all directions, with optional diagonal movement and turn-to-face.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
controlledByenum"player"player, flow, ai, network
maxSpeednumber220px/s
accelerationnumber900px/s²
frictionnumber1200px/s²
allowDiagonalbooleantrueOff = 4-way cardinal only
turningenum"none"none, instant, smooth
rotateSpritebooleanfalseOrient the sprite toward the direction it is moving. Rotation also needs turning set; flipping does not.
spriteFacingenum"rotate"rotate, flipX. How it orients. Rotate suits top-down art; flip suits side-view art, which rotation would turn upside down.
collideWithWorld / clampToStagebooleanfalse
arrivalRadiusnumber8
left/right/up/downKey, wasd——Same input fields as Platformer
movingbooleanfalseoutput
facingenum"right"output

Actions & Conditions ​

Same shared action/condition set as Platformer (Set Move Input, Move Direction, Move Toward, Clear Move Target, Stop, Set Speed, Set Controller Enabled, Set Facing, Face Direction; conditions Can Move, Is Moving, Is Idle, Has Move Target, Facing Is). No jump, ground, or air actions.

Events ​

Move Started, Move Stopped, Direction Changed, Facing Changed, Arrived.


Side-Scroller Controller (sideScrollerController) ​

Category: Control Description: Horizontal-focused movement (no gravity), with an optional vertical axis. Flips the sprite to face travel.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
controlledByenum"player"player, flow, ai, network
maxSpeednumber220px/s
accelerationnumber900px/s²
frictionnumber1200px/s²
sideScrollerVerticalbooleanfalseAlso allow up/down movement
rotateSpritebooleanfalseFlip sprite horizontally to face movement
collideWithWorld / clampToStagebooleanfalse
arrivalRadiusnumber8
left/right/up/downKey, wasd——Same input fields as Platformer
movingbooleanfalseoutput
facingenum"right"output

Actions, Conditions & Events ​

Same shared action/condition/event set as Top-Down. No jump.

Driving a controller with AI

Set the controller's controlledBy to ai and add AI Mover — it drives moveDirection/moveToward/stop for you. For Flow-driven control, set controlledBy to flow and call Move Direction/Move Toward from graphs.


AI Brain (aiBrain) ​

Category: Control Description: Runs reusable .opbrain state machines and behavior trees with per-NPC memory and cancellable tasks.

Choose a blank state machine, blank behavior tree, or Guard template in the Inspector, then New behavior. Edit behavior opens the graph; the Library also opens saved behavior assets. See NPC state machines for the authoring workflow, transition ordering, movement ownership, and Guard setup. See NPC behavior trees for ordered priorities, reusable subtrees, cooldowns, and interruption rules.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueRun the state machine during Play.
behaviorassetRef""Reusable .opbrain asset.
overridesobject{}Initial per-NPC memory values; edited with typed controls.
overrideTypesobject{}hidden; type metadata preserves object-reference remapping.
currentStatestring""output; active leaf state's name.
currentStateIdstring""output; active leaf state's stable ID.
statusstring"idle"output; loading, running, idle, or error status.
errorstring""output; latest loading or execution diagnostic.
blackboardobject{}output; current per-instance variables.

Actions ​

Send Behavior Event queues an event for the next decision. Set Behavior Number, Set Behavior Boolean, Set Behavior Text, Set Behavior Vector, and Set Behavior Object write a declared variable. Restart Behavior restarts from the initial state with authored initial values.

Conditions ​

Is in State checks a state ID against the active path, including parents.

Events ​

EventPayload
State EnteredstateId, name
State ExitedstateId, name

AI Mover (aiMover) ​

Category: Control Description: Drives a character controller (set to Controlled By: AI) to patrol, follow, or flee — no Flow wiring needed.

AI Mover decides where to go; the character controller on the same object does the moving. All speed and acceleration tuning lives on the controller.

Beyond the basic behaviors it can acquire targets by team, path around scenery, report whether it has a clear shot, and break off to hide when hurt. Each of those is opt-in — an AI Mover with default settings costs nothing more than a straight-line chase.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueTurn AI movement on or off.
behaviorenum"patrol"patrol, follow, flee, idle
detectRangenumber0px within which the target is noticed. 0 = always active.
patrolDistancenumber96px from the spawn point before turning back (Patrol).
patrolAxisenum"horizontal"horizontal, vertical (Patrol).
stopWithinnumber8How close to get before stopping (Follow).
seesTargetbooleanfalseoutput; target is within Detect Range.

Targeting

FieldTypeDefaultNotes
targetModeenum"object"object, nearestEnemy, nearestAlly. The auto modes resolve against the Team tag.
targetobjectRef""The chased object in object mode.
retargetIntervalnumber0.25Seconds between re-checks for a closer target.
currentTargetIdstring""output; id of the object currently chased.

Pathfinding

FieldTypeDefaultNotes
avoidObstaclesbooleanfalseWalk around scenery instead of pressing into it.
obstacleGroupstring""Only this group blocks. Empty = anything with a Collider 2D.
agentRadiusnumber0Body width for pathing. 0 = derive from object size.
navCellSizenumber24Nav grid cell size in px. Smaller = tighter routes, costlier search.
repathIntervalnumber0.5Seconds before the route is recalculated while still blocked.
waypointReachnumber16How close counts as reaching a waypoint.
repathTolerancenumber48Recalculate early once the target moves this far from the planned goal.
isPathingbooleanfalseoutput; following a route rather than moving straight.

Line of sight

FieldTypeDefaultNotes
checkLineOfSightbooleanfalseKeep hasLineOfSight current even when not pathing. Implied by avoidObstacles.
hasLineOfSightbooleanfalseoutput; nothing blocks the line to the target.

Cover requests

Use Set Cover Seeking to request or release cover. Health thresholds, hold times, and cooldowns belong in project behavior. Existing projects receive an editable Cover Tactics script when migrated.

FieldTypeDefaultNotes
coverSearchRadiusnumber260How far it will run to reach cover.
useUnmarkedCoverbooleantrueHide behind ANY blocking scenery when no object with a Cover component is in reach. Off restricts this unit to authored cover only.
coverSeekingbooleanfalseoutput; an explicit cover request is active.
isInCoverbooleanfalseoutput; currently hidden from its target.

Actions ​

ActionParamsBehavior
Set BehaviorbehaviorSet patrol/follow/flee/idle.
Set TargettargetChase a specific object. Also switches targetMode to object — otherwise auto-retargeting would overwrite the pick on its next pass.
Set Target ModemodeSwitch between the specific-object and auto modes; clears the held target.
Set EnabledenabledEnable/disable AI movement.

| Set Cover Seeking | seeking | Request cover, or release the current request and reservation. |

Conditions ​

ConditionTrue when
Has TargetA target is resolved — the acquired one in auto modes, not just the authored field.
Sees TargetseesTarget is true.
Has Clear ShothasLineOfSight is true. Needs checkLineOfSight or avoidObstacles on.

Events ​

Target Spotted, Target Lost (no payload).

::: note Requires a character controller AI Mover locates any character controller on the same object each tick and drives it. The controller must be set to Controlled By: AI. :::

Acquisition is deliberately sticky

In the auto modes the current target is held until it dies, leaves Detect Range, or retargetInterval elapses. Re-running acquisition every tick makes a squad jitter between two near-equidistant enemies and costs a full scene scan per unit per frame.

Pathing needs a stage

The nav grid is confined to the scene's stage bounds. Without them the grid only spans the obstacles, and an agent blocked by a wall will route around the outside of the level.


Selectable (selectable) ​

Category: Input Description: Lets the player select this object (click or drag a selection box). Pair with Selection Box on a manager object.

The unit half of RTS selection. It owns no gesture — only the fact "am I selected", the events that fire when that changes, and a highlight ring so the state is visible with no authoring.

Selection is per-object state rather than a list on a manager, so a unit that dies or despawns takes its flag with it. Nothing has to prune a stale id.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueOff makes the object unselectable without removing the component.
selectedbooleanfalseWhether it is selected right now. Read it in rules; Selection Box writes it.
showHighlightbooleantrueDraw a ring under the object while selected.
highlightColorcolor"#5fe0cf"
highlightScalenumber1.15Ring size relative to the object.

Actions ​

ActionParamsBehavior
Select—Mark selected and fire Selected.
Deselect—Clear it and fire Deselected.
Toggle Selected—Flip the current state.

Conditions ​

ConditionTrue when
Is SelectedThis object is currently selected.

Events ​

EventPayloadFires when
Selected—The object became selected.
Deselected—It stopped being selected.

::: note Selection is session state It clears when play stops, so a stopped session never leaves units marked selected back in the editor. :::


Selection Box (selectionBox) ​

Category: Input Description: Click or drag a box to select units (RTS-style), and right-click to issue a move order. Put this on one manager object; put Selectable on the units.

The gesture half. One per scene, on a manager object. It reads the pointer and mouse buttons directly each frame — it is already drawing the marquee per frame, so keeping the gesture and its rendering together avoids splitting one interaction across two places.

For a no-code move order without this component, the On Stage Tap event carries the stage position, the button, and the object under the pointer.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
selectGroupstring""Only units in this group can be selected. Blank means any.
selectTeamstring""Only units on this team can be selected. Blank means any.
selectBindingbindingLeft MouseInput that selects and drags the box.
addBindingbinding(unbound)Held to ADD to the selection instead of replacing it (Shift is the convention).
commandBindingbindingRight MouseInput that issues an order at the pointer.
dragThresholdnumber6Stage units before a click becomes a box drag.
clickRadiusnumber12How close a click must be to a unit's centre to pick it.
clearOnMissbooleantrueClicking empty ground deselects everything.
boxColorcolor"#5fe0cf"

Actions ​

ActionParamsBehavior
Clear Selection—Deselect every unit this box manages.
Select All—Select every eligible unit.

Conditions ​

ConditionTrue when
Has SelectionAt least one managed unit is selected.

Events ​

EventPayloadFires when
Selection Changedcount, idsThe selected set changed.
Command Issuedx, y, targetId, count, idsThe command input fired with units selected.

One event for move and attack

Command Issued carries targetId — empty when the order landed on empty ground (a move), set when it landed on another unit (an attack or follow). One event, one branch, instead of two gestures to wire.


Combat ​

Health (health) ​

Category: Combat Description: Tracks HP, applies damage and healing, emits lifecycle events.

Fields ​

FieldTypeDefaultNotes
hpnumber30Current HP (min 0)
maxHpnumber30Maximum HP (min 1)
invulnerablebooleanfalseBlocks damage
resetOnPlaybooleantrueRefill to maxHp on play start

Events ​

EventPayload
damagedamount, remainingHp
healedamount, remainingHp
diedremainingHp (0)

Actions ​

ActionParamsBehavior
damageamountSubtract HP; emit damaged; emit died at 0.
healamountAdd HP up to maxHp; emit healed.
setHpvalueClamp and emit damaged/healed/died as needed.
setMaxHpvalue, adjustCurrentRaise/lower max HP; optionally clamp current.
refill—Set HP to maxHp.
kill—Force HP to 0; emit died.

Conditions ​

ConditionParamsTrue when
isDead—HP ≤ 0
isAlive—HP > 0
isAtFull—HP ≥ maxHp
hpAtLeastvalueHP ≥ value
hpBelowvalueHP < value

Lifecycle ​

  • onAttach: Clamps HP to maxHp if needed.
  • onPlayStart: Refills HP when resetOnPlay is true.

Stats (stats) ​

Status: Deprecated for new attachments. This fixed Attack/Defense/Speed schema is an RPG recipe. Define your game's stats in a project Behavior Component; existing Stats fields, modifiers, Flow and native script calls remain supported.

Category: Combat Description: Attack, defense, and speed with temporary bonuses.

Fields ​

FieldTypeDefaultNotes
atknumber5Base attack
defnumber1Base defense
spdnumber5Base speed (used by Turn Queue)
atkBonus / defBonus / spdBonusnumber0Hidden modifiers

Effective values in logic: base + bonus.

Events ​

EventPayload
statChangedstat, oldValue, newValue

Actions ​

ActionParams
addModifierstat (atk/def/spd), amount
setBasestat, value
clearModifiers—

Conditions ​

ConditionParams
fasterThanother (objectRef) — compares effective speed to another object's Stats; falls back to otherSpd when empty

Ability Cooldown (abilityCooldown) ​

Category: Combat Description: Timed gate for abilities; counts down each frame.

Fields ​

FieldTypeDefault
durationnumber1.5 (seconds)
remainingnumber0 (read-only)
autoStartbooleanfalse

Events ​

used, ready.

Actions ​

ActionReturns
usefalse if still cooling; otherwise starts timer and emits used
forceReadyClears remaining; emits ready
setDurationvalue — updates duration

Conditions ​

canUse (remaining ≤ 0), isCoolingDown.

Lifecycle ​

  • onPlayStart: Sets remaining from autoStart.
  • onTick: Decrements remaining; emits ready when it hits zero.

Combat Action (combatAction) ​

Status: Deprecated for new attachments. Author your game's damage formula and turn advancement in a project Behavior Component. Use Health's accepted command results to distinguish refused damage from applied damage. Existing Combat Action attachments retain their behavior.

Category: Combat Requires: statsDescription: Applies stat-based attacks to another object's Health.

Damage formula: attacker atk + atkBonus + power + bonusPower − target def/defBonus, clamped to minimum damage. Friendly fire is blocked unless enabled.

Fields ​

FieldTypeDefault
powernumber0
minDamagenumber1
variancenumber0
useDefensebooleantrue
allowFriendlyFirebooleanfalse

Events ​

attacked (attackerId, targetId, amount), blocked (attackerId, targetId, reason).

Actions ​

ActionParams
attacktargetId, power, minDamage, optional endTurn + turnQueueId

Conditions ​

canAttack — target exists, has Health above 0, and is not an ally unless friendly fire is enabled.


Ranged Weapon (rangedWeapon) ​

Category: Combat Description: Fires at an enemy on a cooldown when it is in range and the shot is clear. Hitscan damage or a spawned projectile.

The other combat components each cover one piece: Combat Action applies a melee-range hit now, Hazard damages on contact, Projectile handles flight. Ranged Weapon is the one that decides when to shoot, at what, and whether the shot is worth taking.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
autoFirebooleantrueShoot on its own whenever a target is in range. Off = only on an explicit Fire.
fireModeenum"hitscan"hitscan (instant damage) or projectile (spawn a prefab).
rangenumber260Max firing distance in px. 0 = unlimited.
cooldownnumber0.8Seconds between shots.
aimFacingenum"none"none, rotate, flipX. How the object turns toward what it shoots.
canFirebooleanfalseoutput; cooled down, with a valid target in range and in sight.
currentTargetIdstring""output; what it is aiming at.

Damage (hitscan mode)

FieldTypeDefaultNotes
damagenumber2HP removed per shot.
damageVariancenumber0Random ± swing per shot. A hit never lands for 0.

Targeting

FieldTypeDefaultNotes
targetModeenum"auto"auto (nearest enemy), mover (AI Mover target, then nearest enemy), or object.
targetobjectRef""The target in object mode.

Line of sight

FieldTypeDefaultNotes
requireLineOfSightbooleantrueHold fire when scenery blocks the line. Off = arcing weapons that shoot over cover.
obstacleGroupstring""Only this group blocks shots. Empty = anything with a Collider 2D.

Muzzle and projectiles

FieldTypeDefaultNotes
muzzleX / muzzleYnumber0Where shots leave from, in the object's own space.
projectilePrefabprefab""Prefab spawned per shot (projectile mode).
projectileSpeednumber600px/s (projectile mode).

Actions ​

ActionParamsBehavior
Fire—Shoot now. Still respects enabled, cooldown, range, and line of sight.
Set EnabledenabledEnable/disable the weapon.

Conditions ​

ConditionTrue when
Can FirecanFire is true.
Has TargetA target is resolved.

Events ​

EventPayloadFires when
FiredtargetId, angleA shot leaves the muzzle (both fire modes).
HittargetId, amountHitscan damage was applied.

It shares AI Mover's target on purpose

New weapons use independent nearest-enemy targeting in auto mode. Choose mover to share an eligible AI Mover target, falling back to the nearest enemy when necessary. Version-one attachments migrate to mover to preserve their behavior.

Zero variance makes evenly-matched fights end in draws

With damageVariance: 0 every duel between identical units resolves on the same frame, so symmetric battles reliably end in mutual annihilation. A small variance desynchronizes them.

::: note Friendly fire is never possible Targets are filtered by the Team tag. A unit with no Team is neither ally nor enemy, so it is never shot — and never shoots. :::


Area Damage (areaDamage) ​

Category: Combat Description: Damages everything within a radius once, with distance falloff. The blast for rockets, grenades, mines, and exploding barrels.

Hazard damages what touches it and Combat Action damages one target; neither can express "everything near this point takes a hit". Attach this to a shell, a mine, a barrel, or a bare marker.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
radiusnumber90How far the blast reaches, in px.
damagenumber12HP removed at the center of the blast.
falloffbooleantrueScale damage down toward the rim. Off makes the blast a flat disc, so where you stand inside it stops mattering.
minDamagenumber1Damage floor at the very edge when Falloff is on.
detonateOnStartbooleantrueGo off as soon as it spawns — right for a shell that has already landed. Off waits for a Detonate call, which is how a mine or a timed charge works.
destroySelfbooleantrueRetire this object once it has gone off.
targetGroupstring""Only objects in this group or team can be hurt. Empty = anything with Health.
allowFriendlyFirebooleantrueLet the blast hurt the shooter's own team. On by default — an explosion that spares your squad reads as fake.
blockedByCoverbooleanfalseRequire a clear line from the blast to each victim, so scenery shields people behind it.
obstacleGroupstring""Which group shields the blast. Empty = anything with a Collider 2D.

Actions ​

ActionParamsBehavior
Detonate—Go off now. Only ever fires once.

Conditions ​

ConditionTrue when
Has DetonatedIt has already gone off.

Events ​

EventPayloadFires when
DetonatedhitCount, radius, x, yThe blast went off.

Friendly fire is ON by default

An explosion that politely spares your own squad reads as fake, and blowing up your own soldier is a defining moment of the genre. The shell carries no Team of its own — the blast resolves sides through the object it was spawned from, so a projectile must be fired with spawn provenance for allowFriendlyFire: false to mean anything.

It detonates on the first TICK, not at play start

Play start walks objects in scene order and Health refills to maxHp in its own start hook, so a blast that fired during that sweep would have its damage silently undone on every victim that happened to start after it.


Ballistic (ballistic) ​

Category: Combat Description: Flies a shot from where it spawned to where it was aimed — straight and blockable, or arcing over cover. Pairs with Area Damage for explosive rounds.

Opal's other projectile, Projectile, is a physics arrow: it needs a Rigid Body, a Collider and a live physics world, and its purpose is welding into what it hits. A bullet or grenade wants none of that. Ballistic is kinematic — it moves itself and finds its own impact — so a firefight can put dozens of shots in the air without a physics body each.

Travel time is the point. A hitscan shot cannot be dodged, cannot miss a moving target, and cannot land behind someone.

Flight modes ​

ModeBehaviour
directFlies along its heading and stops at the first obstacle. Cover blocks it. This is a bullet.
lobbedArcs to the point it was aimed at, passing over everything. Cover does not protect you. This is a grenade.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
flightModeenum"direct"direct, lobbed. Direct shots stop at the first obstacle. Lobbed shots arc over everything and land where they were aimed.
speednumber420Travel speed in px/s. Slower shots can be dodged, which is what makes positioning matter.
maxRangenumber0Distance before it gives out. 0 = until it hits something or Lifetime expires.
lifetimenumber4Seconds before a shot that hit nothing expires. Stops strays living forever.
damagenumber0HP removed by a clean hit. Leave at 0 when an Area Damage blast is the whole weapon.
hitRadiusnumber14How near a target counts as a hit. Too small and fast shots tunnel straight through people.
targetGroupstring""Only objects in this group or team can be hit. Empty = anything with Health.
hitOwnTeambooleantrueLet the shot hit the shooter's own side. The shooter itself is always immune.
obstacleGroupstring""Which group stops a direct shot. Lobbed shots ignore this entirely — they go over. Empty = anything with a Collider 2D.
arcHeightnumber48How high a lobbed shot rises at the peak of its arc, in px. Purely visual lift — the shot is untouchable while airborne.
spinnumber0Degrees per second the shot tumbles in flight. Grenades read better with a little.
flyingbooleanfalseoutput;
travelednumber0output;

Actions ​

ActionParamsBehavior
Detonate Now—End the flight immediately where it is.

Conditions ​

ConditionTrue when
Is FlyingThe shot is still in the air.

Events ​

EventPayloadFires when
ImpacttargetId, reason, x, yThe shot hit something, landed, or expired.

reason on impact is one of hit (struck a target), cover (stopped by scenery), landed (reached its aim point or max range), expired (lifetime ran out), or manual.

Aim points arrive through the spawn

Ranged Weapon in projectile mode passes the point it was aiming at as spawn launch data. A lobbed shot needs it — position and rotation alone cannot say "land here". A shell spawned without it simply flies its configured maxRange.

Collision is swept, not sampled

Impact is tested against the whole step, not just the endpoint. At 4000 px/s a frame is a 66px jump — endpoint-only checks would sail straight through a target.

The arc is visual lift only

A lobbed shot's height is cosmetic; the ground track still ends exactly on the aim point. Making the height real would move where it lands.


Cover (cover) ​

Category: Combat Description: Marks this object as a place units can take cover behind. Hands out standing spots on the side away from the shooter, and limits how many can shelter at once.

Put this on a sandbag, wall, crate or rock. It gives two things that inferring cover from raw geometry cannot:

  • Authored intent. The designer decides what counts as cover. A decorative crate is not automatically a firing position just because it happens to block a sightline.
  • Occupancy. Spots are claimed, so a squad spreads across the map instead of three soldiers piling onto one sandbag.

AI Mover prefers marked cover, and falls back to unmarked scenery only when nothing authored is in reach (see its useUnmarkedCover).

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueTurn this cover off without deleting it — useful once it is destroyed.
capacitynumber1How many units can shelter here at once. More than one and they fan out along the face.
standoffnumber26How far clear of this object's edge a unit stands, in px.
slotSpacingnumber30Gap between units sharing this cover.
releaseDistancenumber260Once a claimant has ARRIVED, moving further than this frees its spot automatically. It never applies while a unit is still on its way. 0 = never auto-release.
claimTimeoutnumber8Seconds a unit may reserve this without arriving before the spot is freed. Stops a reservation from leaking when the claimant never makes it.
qualitynumber1Preference weight when a unit is choosing between cover. Higher wins ties; a sandbag nest can outrank a thin post.
occupantsnumber0output;
isFullbooleanfalseoutput;

Actions ​

ActionParamsBehavior
ClaimclaimantId, threatX, threatYReserve a spot and get the world position to stand at. Returns null when full or disabled.
ReleaseclaimantIdGive up a claimed spot.
Release All—

Conditions ​

ConditionTrue when
Is FullEvery slot is claimed.
Has RoomAt least one slot is free.

Events ​

EventPayloadFires when
ClaimedclaimantId, occupantsA unit took this cover.
ReleasedclaimantId, occupantsA unit gave this cover up.

Claims are validated, never trusted

Every tick this drops claimants that died, left the scene, arrived and then wandered past Release Distance, or reserved a spot and never showed up (Claim Timeout). A unit killed on its way to cover cannot call Release, so without this the map slowly fills with reservations held by corpses.

The distance check only applies after arrival

A unit claims from wherever it is standing, which is usually further away than Release Distance. Releasing on distance while it is still travelling would revoke the spot on the very next tick and loop forever — so a claim is only distance-released once the claimant has reached the cover at least once.


Turn Queue (turnQueue) ​

Status: Deprecated for new attachments. This component combines sequencing with defeated-unit eligibility, Speed initiative, battle victory and indicator placement. Author those rules in a project Behavior Component. Existing queues and their events remain supported.

Category: Combat Description: Cycles turns across objects in a named Group. Attach to a controller object; fighters share the same group string on their Thing.

Fields ​

FieldTypeDefaultNotes
groupstring""Scene group name (e.g. Combatants)
orderenum"registered"registered, speedDesc, random
skipDefeatedbooleantrueIgnore visible members whose Health is 0
stopWhenOneTeambooleantrueEnd a multi-team battle once one team remains
activeIdstring—hidden; current actor object id
queuestring—hidden; comma-separated id queue
indicatorIdobjectRef""Optional arrow/marker snapped above the active combatant
indicatorOffsetYnumber-48Gap used for automatic indicator placement

Events ​

turnStart (actorId), turnEnd (actorId), roundStart, queueEmpty, battleEnd (winningTeam).

Actions ​

ActionDescription
rebuildCollect visible group members and rebuild queue.
nextEnd current turn, advance; auto-rebuild if empty; may emit roundStart; moves indicatorId when set.
positionIndicatorSnap marker above the active combatant (marker, offsetY).

Conditions ​

isActive — compares activeId to a given object ref.

Ordering ​

  • speedDesc: Sort by Stats spd (higher first).
  • random: Shuffle member ids.
  • registered: Scene order of members.

Team (team) ​

Category: Combat Description: Faction tag for ally/enemy checks in graphs.

Fields ​

FieldTypeDefaultNotes
namestring"neutral"e.g. player, enemy

Actions ​

setTeam — value (string).

Conditions ​

ConditionParams
isAllyother (objectRef) — same team name
isEnemyother — different non-empty team

Network Hit (networkHit) ​

Status: Deprecated for new attachments. Use Network Input targeting an explicitly authorized [NetworkAction] for new bindings. Existing Network Hit attachments keep their bounded host-authorized Health damage and cooldowns; ordinary guest scripts remain disabled.

Category: Combat Description: Explicitly permits a configured Health hit from a key or tap. Local games apply it locally; in a multiplayer room only the host applies the canonical damage.

Fields ​

FieldTypeDefaultNotes
amountnumber1Exact permitted damage, greater than zero and at most 1,000,000.
cooldownMsnumber150Per-player cooldown, 100–60,000 milliseconds.
keystring""Optional shortcut key, such as 1. Repeats, modifier chords and typing are ignored.
tapbooleantrueAllow a press/release over the same object's bounds, without dragging away.

Behavior and dependencies ​

Configure these permission fields in the inspector; they do not generate Flow getter/setter nodes. Requires enabled Health on the same object. The shared editor/player input spine handles this declarative input before the guest gameplay guard and after UI consumption. The host checks room membership, the enabled component, exact damage, living Health and cooldown using its own world. Requests cannot install or expand the policy. Disabling the component, hiding the object or turning network sync off removes the grant. No additional actions, conditions, events or component lifecycle callbacks are declared; ordinary Health events drive authored reactions. The host's OpalScripts and Flow produce the replicated consequences. Guests never run those callbacks.

An injected embedding authorization policy takes precedence, including refusals. This is a shared target interaction, not general player input forwarding. Host departure freezes guest gameplay. See Multiplayer and sharing and the Crystal Crew example, which now uses general OpalScript network actions.


Health Bar (healthBar) ​

Category: UI Requires: healthDescription: Draws an HP bar above the object.

Fields ​

FieldTypeNotes
width, heightnumberBar size
offsetYnumberVertical offset above sprite
showWhenFullbooleanHide bar at full HP
showOnHoverbooleanShow on pointer hover or after damage
fillColor, bgColor, lowColorcolorBar colors
lowThresholdnumber0–1 fraction for "low HP" color
flashOnHitbooleanBrief flash on damage
visiblebooleanhidden; runtime visibility

Events ​

barShown, barHidden.

Actions ​

show, hide, flash.

Conditions ​

isVisible.

Sibling handlers ​

Reacts to Health on the same object without extra graph wiring:

Handler keyBehavior
health.damagedFlash bar; show if showOnHover.
health.diedHide bar.

Hazard (hazard) ​

Category: Combat Requires: collider2d (auto-attached) Description: Damages objects that touch it (targets need Health). Auto-adds a sensor Collider 2D.

Fields ​

FieldTypeDefaultNotes
damagenumber1HP removed per hit
targetGroupstring""Only objects in this group/team take damage; empty = anyone with Health
continuousbooleanfalseKeep damaging on interval while in contact
intervalnumber0.5Seconds between hits when continuous
destroySelfbooleanfalseVanish after dealing damage (projectiles)

Events ​

EventPayload
Hurt SomethingtargetId, targetName, amount

::: note How it hurts Hazard runs the target's health.damage action on each qualifying contact. With continuous off, it damages a given target once per contact; with it on, every interval seconds while still touching. :::


Items ​

Inventory (inventory) ​

Category: Items Description: Named item stacks (serialized as an internal string map).

Fields ​

FieldTypeDefaultNotes
capacitynumber99Max distinct item types
itemsstring""Read-only encoded stacks

Events ​

itemAdded, itemRemoved, full.

Actions ​

ActionParams
additem, count
removeitem, count
clear—

Conditions ​

has (item), hasAtLeast (item, count).


Pickup (pickup) ​

Category: Items Requires: collider2d (auto-attached) Description: Collectible: when a qualifying object overlaps it, fires Collected and vanishes. Auto-adds a sensor Collider 2D.

Fields ​

FieldTypeDefaultNotes
collectorGroupstring""Only objects in this group/team can collect; empty = anyone
pointsnumber1Score value in the Collected payload
vanishbooleantrueHide on collect (uses Sprite Renderer's collect animation if present)
collectedbooleanfalseoutput; true once picked up

Actions ​

ActionBehavior
ResetMake the pickup collectible again and show it.

Conditions ​

Is Collected — collected is true.

Events ​

EventPayload
CollectedbyId, byName, points

::: note Vanish animation On collect, Pickup runs the Sprite Renderer collect action if one is present on the same object; otherwise it hides and marks done directly. :::


Logic ​

Timer (timer) ​

Category: Logic Description: Counts down and fires Completed when it elapses. Loops on demand. Drive it from Flow or auto-start on play.

Fields ​

FieldTypeDefaultNotes
durationnumber1seconds
autoStartbooleantrueStart counting when play starts
loopbooleanfalseRestart automatically on completion
runningbooleanfalseoutput
elapsednumber0output; seconds counted
remainingnumber0output; seconds left

Actions ​

ActionBehavior
StartStart or resume.
RestartReset to zero and start.
StopPause where it is.
ResetStop and clear elapsed to zero.
Set DurationSet duration in seconds.

Conditions ​

Is Running, Is Done (not running, elapsed ≥ duration, duration > 0).

Events ​

EventPayload
Startedduration
Completedduration
Loopedcount

Spawner (spawner) ​

Category: Control Description: Spawns a prefab on an interval at this object's position. Great for enemy waves, obstacles, and pickups.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
prefabassetRef""Prefab asset to spawn (assetKind: blueprint)
intervalnumber1.5seconds between spawns
autoStartbooleantrueBegin spawning on play start
spawnOnStartbooleanfalseEmit first spawn immediately
limitint0Max spawns; 0 = unlimited
offsetX / offsetYnumber0Spawn offset from this object
runningbooleanfalseoutput
spawnCountnumber0output; total spawned this play

Actions ​

ActionBehavior
StartStart the spawner.
StopStop the spawner.
ResetClear spawn count for a fresh limit.
Spawn NowSpawn one prefab immediately, ignoring interval.

Conditions ​

Is Spawning — running is true.

Events ​

EventPayload
Spawnedprefab, x, y, count
Finishedcount

Prefabs are assets

Spawner spawns a prefab — a reusable object blueprint. Author the object once, save it as a prefab, then point prefab at it.


Physics (2D) ​

See the Physics guide for setup, coordinates, and troubleshooting.

Rigid Body 2D (rigidBody2d) ​

Category: Physics Description: Simulates mass and velocity. Requires Collider 2D to collide with other objects.

Fields (selected) ​

FieldTypeDefaultNotes
bodyTypeenum"dynamic"dynamic, fixed, kinematicPosition, kinematicVelocity
gravityScalenumber10 disables gravity for this body
linearDampingnumber0Slows linear motion
lockRotation / lockX / lockYbooleanfalseAxis locks
vx, vy, speed, sleeping——Read-only at runtime

Events ​

collisionStart, collisionEnd — payload: otherId, otherName, started, sensor.

Actions ​

setVelocity, addVelocity, applyImpulse, setAngularVelocity, teleport, setBodyType, setEnabled, wake, sleep. Teleport coordinates are the world-space visual origin, including under transformed parents.

Conditions ​

isDynamic, isKinematic, isMoving, isSleeping.


Collider 2D (collider2d) ​

Category: Physics Description: Collision shape for Rapier. Collider-only attachments become implicit fixed bodies (floors, walls).

Fields (selected) ​

FieldTypeDefaultNotes
shapeenum"box"box, circle, capsule
useObjectSizebooleantrueMatch sprite bounds
sensorbooleanfalseTrigger only — no physical push
frictionnumber0.7Surface friction
restitutionnumber0Bounce (0–1)
colliding, contactCount——Read-only at runtime

Events ​

Same collision events as Rigid Body 2D.

Actions ​

setSensor, setEnabled.

Conditions ​

isSensor, isColliding, hasContacts.


Joint 2D (joint2d) ​

Category: Physics Description: 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).

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
targetobjectRef""Other object this joint connects to
typeenum"revolute"revolute (hinge), fixed (weld), distance (rope/spring)
anchorX / anchorYnumber0Body-local pixels (0,0 = centre)
targetAnchorX / targetAnchorYnumber0Target body-local
limitMin / limitMaxnumber-180 / 180Degrees; revolute only
motorSpeednumber0rad/s; revolute only
motorForcenumber0revolute only
restLengthnumber0distance joint natural length; 0 = capture current separation
stiffnessnumber00 = rope (max length only), >0 = spring
collideConnectedbooleanfalseAllow connected bodies to collide
breakForcenumber0Max anchor separation (px) before break; 0 = unbreakable

Actions ​

ActionParamsBehavior
Set EnabledenabledEnable/disable; releases physics on disable.
Break Joint—Disable and release the joint.
Set Limitsmin, maxSet hinge angle limits (revolute).
Set Motorspeed, forceSet motor speed/force (revolute).

Events ​

Broke — otherId, force.


Soft Body 2D (softBody2d) ​

Category: Physics Description: Deformable jelly and cloth made from a spring-connected particle mesh. Sprite artwork deforms with the mesh; objects without artwork use Fill Color. Add it directly to a sprite or shape. The inspector provides Jelly, Cushion, Flag, and Curtain presets, each applied as one undo step. Resize the object to change its rest dimensions.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueOwns the object's physics while enabled; ordinary rigid body/collider settings on the same object are unused
modeenumjellyJelly preserves area; cloth folds freely
shapeenumboxBox or ellipse; jelly only. Cloth uses a rectangular mesh
columns / rowsnumber7 / 7Particle counts per axis, 3–12; at most 144 particles per object
pinningenumnonenone, topCorners, topEdge, leftEdge, or corners; holds those particles at their authored world positions
stiffnessnumber0.65Stretch resistance, 0–1; controls spring frequency
areaStiffnessnumber0.8Area preservation, 0–1; jelly only
bendStiffnessnumber0.2Resistance to folding across neighboring mesh cells, 0–1
dampingnumber0.65Spring damping ratio, 0–2; around 1 settles quickly
linearDampingnumber0.5Air resistance, 0–20
massnumber1Total mass shared among movable particles, 0.01–1000
gravityScalenumber1Gravity multiplier, −10–10
initialVx / initialVynumber0 / 0Initial world velocity in pixels/second; positive Y points down
particleRadiusnumber0Particle collision radius in local pixels; 0 fits mesh spacing automatically; positive values are capped by spacing
frictionnumber0.5Sliding resistance, 0–4
restitutionnumber0.1Contact bounce, 0–1
ccdbooleantrueContinuous collision for fast-moving particles
colorcolor#8b9dffFill when the object has no sprite artwork
showMeshbooleanfalseDraw wireframe during Play and in exported games
particleCountnumber0read-only; live particle count
speednumber0read-only; center-of-mass speed in pixels/second
deformationnumber0read-only; mean relative stretch/compression of mesh edges; 0.1 is about ten percent
contactCountnumber0read-only; number of other scene objects in contact

Actions ​

ActionParamsBehavior
Apply Impulsex, yDistribute a total world-space impulse across movable particles
Set Velocityx, ySet all movable particles' velocity in pixels/second
Reset Shape—Restore the creation pose, rest shape, and initial velocities
Set EnabledenabledEnable or release the soft body; ordinary rigid physics can resume when disabled

Events ​

Collision Start and Collision End carry otherId, otherName, started, and sensor. Contacts are grouped by the other scene object, so several touching particles do not create duplicate object-level events.

Boundaries ​

Collision uses particle circles, not a continuous deformable surface: small objects can pass through gaps. A body's own particles do not collide with each other, so cloth can fold through itself. This is a spring mesh with area correction, not a fluid or finite-element material model. There is no tearing or remeshing. Higher resolution costs more rigid bodies, springs, and rendering work; start at 7 × 7 and measure the target device.

Soft bodies do not support skeletons, Tile Map 2D, or an enabled character controller on the same object. Sprite Material 2D lighting, emission and normals follow the deformed mesh, including rotated and mirrored artwork. Joint 2D cannot attach to soft-body particles or target a soft body. Pins attach to the authored pose; attaching arbitrary particles to moving objects is not exposed in this release. Saved scenes and exported packages store only authored fields, never simulated particle positions or live outputs.


Fluid 2D (fluid2d) ​

Category: Physics Description: Experimental particle liquid with shared-domain emitters, solid boundary coupling, and smooth surface rendering. The object's rectangle defines the initial fill, not the container. Use separate solid colliders for walls. Open Help → Fluid Playground… for a working example; see Experimental liquid for setup and limits.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueEnable the domain; disabling releases its live particles
initialFillbooleantrueFill the object's rotated/scaled rectangle on start or reset
restDensitynumber1Mass per square pixel, 0.01–100; matches collider density units
viscositynumber0.02Velocity Smoothing, 0–0.2; numerical damping, not calibrated viscosity
spacingnumber8Sample spacing in world pixels, 4–32; changing it resets the running domain
maxParticlesint2000Budget, 32–8000; emission pauses when full; high values need measurement
iterationsint5Maximum compression correction passes per microstep, 1–12
compressionTolerancenumber0.000001Early-exit target, 0–0.05; raising it can destabilize light props; not a guaranteed error bound
vorticitynumber0Swirl Preservation, 0–1; optionally restore a bounded share of smoothing energy loss; not surface tension
colorcolor#428de8Liquid tint
renderModeenumsurfacesurface or particles
surfaceOpacitynumber0.94Smooth surface opacity, 0.1–1
foamIntensitynumber0.45Visual foam where exposed water is disturbed (impacts, shear, breakup), 0–1; uniform flow stays clear; no added physics particles
highlightIntensitynumber0.55Surface rim highlight strength, 0–1
showParticlesbooleanfalseOverlay particle samples on the surface
showVelocitybooleanfalseOverlay live velocity arrows
particleCountnumber0read-only; current number of live particles
densityErrornumber0read-only; mean positive relative compression, excluding free-surface deficits
renderMsnumber0read-only; CPU surface work including Canvas raster/draw or WebGL submission; excludes asynchronous GPU completion
maxDensityErrornumber0read-only; maximum positive density error in the latest microstep
solverIterationsnumber0read-only; latest microstep correction count
runtimeMsnumber0read-only; fluid CPU per fixed tick, excluding Rapier solve, sync, publication and rendering
emittedRate / drainedRatenumber0read-only; actual births/removals per latest tick divided by tick duration
blockedCountnumber0read-only; occupied or solid-blocked birth attempts in the latest tick
capacityCountnumber0read-only; birth attempts rejected by capacity in the latest tick

Actions ​

ActionParamsBehavior
Sample Waterx, yDetached point occupancy and weighted flow from committed liquid; see typed Fluid2D.SamplePoint
Clear Liquid—Remove all live particles
Reset Liquid—Clear and recreate the initial fill; separate props retain their poses
Set EnabledenabledEnable or release the live domain

Authored settings and object references save normally. Live particles and output values do not persist. The experimental PBF solver supports solid rigid colliders; separate domains, soft bodies, skeleton bones, and network peers do not exchange fluid state.


Fluid Emitter 2D (fluidEmitter2d) ​

Category: Physics Description: Pour particles into a selected Fluid 2D domain. Multiple emitters feeding the same domain interact. Object width sets the nozzle width and rotation turns its local velocity.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueContinuous emission enabled
domainobjectRef""Fluid 2D object to receive particles
ratenumber100Requested particles per second, 0–2000
velocityX / velocityYnumber0 / 100Local pixels per second, −4000–4000; rotated with nozzle
emittedRatenumber0read-only; actual births per latest tick divided by tick duration
blockedCount / capacityCountnumber0read-only; occupied/solid-blocked or budget-rejected attempts in the latest tick
domainAvailablebooleanfalseread-only; a live domain is available

Actions ​

ActionParamsBehavior
Emit BurstcountRequest 1–2000 particles in a compact block at the nozzle; respects occupied slots and budget
Set EmittingenabledStart/stop continuous emission; explicit bursts remain available

Fluid Drain 2D (fluidDrain2d) ​

Category: Physics Description: Remove particles from the selected domain inside this object's rotated/scaled rectangle. No sensor collider is required.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueDrain enabled
domainobjectRef""Fluid 2D object to drain
drainedRatenumber0read-only; removals per latest tick divided by tick duration
domainAvailablebooleanfalseread-only; a live domain is available

Actions ​

ActionParamsBehavior
Set DrainingenabledEnable/disable removal

Fluid Probe 2D (fluidProbe2d) ​

Category: Physics Description: Observe approximate liquid occupancy at this object's center plus a local offset. Latest committed physics positions supply flow and relative movement. A point probe is not an exact volume/depth measurement or a swept contact detector.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueEnable observations; disabling clears live state
domainobjectRef""Fluid 2D domain to sample
offsetX / offsetYnumber0Local point offset, rotated and scaled with the object
enterCoveragenumber0.4Entry occupancy threshold, 0.001–1
exitCoveragenumber0.25Exit threshold, 0–1, capped at entry threshold to prevent chatter
splashSpeednumber120Minimum relative entry speed in pixels/second for a splash event
wetbooleanfalseread-only; point occupancy after hysteresis
coveragenumber0read-only; kernel occupancy estimate, 0–1
velocityX / velocityYnumber0read-only; weighted local water flow, world pixels/second
speednumber0read-only; water speed in pixels/second
relativeSpeednumber0read-only; probe speed relative to water
domainAvailablebooleanfalseread-only; exact referenced domain belongs to the current simulation

Events and conditions ​

Entered Water, Exited Water and Splash publish a FluidContact snapshot to Flow and OpalScript. Splash requires a prior available-domain observation and sufficient relative speed; spawning or first binding inside water does not splash. In Water reads the current wet state. See FluidProbe2D and FluidContact for typed signatures and examples.


Ragdoll (ragdoll) ​

Category: Physics Description: Makes a skinned skeleton go limp using physics bones authored in Skeleton Studio. Activate on death or via action.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrue
activateOnDeathbooleantrueActivate ragdoll when Health dies
activebooleanfalseoutput; currently limp; version 2 drops saved activity
blendBacknumber0hidden; reserved, retained for stored-data compatibility; does not blend

Actions ​

ActionParamsBehavior
Activate—Spawn bone bodies at the current animated pose and go limp; stops skeleton clips.
Deactivate—Free bone bodies; bones keep last limp pose.
Impulse BoneboneId, x, yApply a linear impulse to one physics bone.

Events ​

EventPayload
Activated—
Bone HitboneId, otherId, otherBoneId

::: note Activates on death With activateOnDeath on, Ragdoll listens for the Health died sibling event and activates automatically. :::


Projectile (projectile) ​

Category: Physics Description: Arrow / bolt / dart flight: points along velocity while flying and can weld into what it hits. Requires dynamic Rigid Body 2D + Collider 2D. Enable Continuous Collision on the rigid body so fast shots don't tunnel.

Fields (selected) ​

FieldTypeDefaultNotes
enabledbooleantrue
alignToVelocitybooleantrueFace direction of travel each tick
minAlignSpeednumber30px/s; skip alignment when slower
turnSpeednumber0deg/s; 0 = snap instantly
angleOffsetnumber0Degrees if art doesn't point +X at rotation 0
stickOnHitbooleantrueWeld into first solid hit (sensors never stick)
ignoreOwnerbooleantrueNever stick to the spawner / owner hierarchy
stickGroup / ignoreGroupstring""Optional group filters
armDelaynumber80ms before sticking arms (avoids welding to shooter on spawn)
breakForcenumber0Max anchor separation (px) before tear-free; 0 = stuck for good
stuck / stuckToId——output

Actions ​

ActionParamsBehavior
Launchspeed, angleFire along facing (or explicit angle); unsticks first and re-arms stick delay
Unstick—Release the weld
Set OwnertargetIdAssign who fired this (spawned projectiles get owner automatically)

Conditions ​

Is Stuck

Events ​

EventPayload
StuckotherId, otherName
UnstuckotherId, reason

Scene ​

Scene Camera (scene_camera) ​

Category: Scene Description: Named camera shots with tracking, bounds and optional simultaneous screen views. Camera controls use world positions and game time; their Play state is separate from saved authorship.

Fields ​

FieldTypeDefaultNotes
playerFitenum"cover"cover fills this output; contain fits the stage with margins. Shared by editor Play and the exported player.
zoomnumber10.35–4; the same range for authoring and live controls.
followInPlaybooleanfalseTrack the configured target in Play.
previewFramebooleantrueDraw this camera's frame guide in Arrange.
followTargetIdobjectRef""Initial framing target; continuously tracked when follow is enabled.
followSmoothingMsnumber450Damping time in game milliseconds; 0 snaps.
followOffsetXnumber0World-unit horizontal offset.
followOffsetYnumber0World-unit vertical offset.
deadZoneWidthnumber0Visible-frame fraction (0–1) within which the target can move without horizontal tracking.
deadZoneHeightnumber0Visible-frame fraction (0–1) for vertical tracking.
boundsModeenum"none"none, stage, or custom; constrains the visible world rectangle.
boundsXnumber0Custom bounds left edge.
boundsYnumber0Custom bounds top edge.
boundsWidthnumber1024Custom bounds width. A smaller area than the visible frame is centered.
boundsHeightnumber720Custom bounds height.
outputModeenum"primary"primary draws when this camera is active; viewport draws an additional view; disabled produces no output.
outputXnumber0Fraction of the canvas from its left edge.
outputYnumber0Fraction of the canvas from its top edge.
outputWidthnumber1Canvas width fraction, clipped at the right edge.
outputHeightnumber1Canvas height fraction, clipped at the bottom edge.
outputOrdernumber0Higher values draw above lower ones; ties draw the primary first, then use stable camera-ID order.
inputEnabledbooleantruePointer input uses the foremost eligible view. Disabled input lets gestures reach a view behind it.
isDefaultbooleanfalseRead-only startup status; choose Use at scene start in the camera inspector.

Actions ​

ActionParamsBehavior
Set ZoomvalueImmediately change this camera's zoom.
Follow ObjecttargetId, followInPlaySet or release this camera's continuous tracking.
Clear Follow—Release tracking and the current move.
Reset camera—Reset framing and clear motion.
Zoom Tovalue, durationEase to a zoom while continuing any active follow.
FocustargetId, zoom, durationFrame a target's world position without enabling follow.
Move Tox, y, zoom, durationMove to a world position.
Activate Camera—Use this camera as the primary output for this Play session.
Shakeintensity, durationShake this view, respecting reduced motion.
Stop Motion—Stop movement, follow and shake at the current pose.
World To Screenx, yProject a world point through this camera's current resolved view into canvas CSS pixels.
Screen To Worldx, yInverse projection through this camera's current resolved view.

Component action durations are game milliseconds; typed OpalScript ZoomTo, Focus, MoveTo and Shake take seconds. New moves interrupt older ones. A missing target refuses Focus/Follow; deleting a followed target releases tracking.

Events and conditions ​

moveCompleted, moveCancelled, and shakeCompleted carry camera/target IDs, resulting center and zoom, duration and reason. Conditions: isDefault, hasFollowTarget.

Use Create → Camera for another named shot. The camera inspector offers full-screen, split-left, split-right and inset presets. Existing cameras receive additive version-2 defaults; the persisted scene setting activeCameraId chooses the startup camera. Runtime activation does not change saved startup settings.

Screen-space HUDs and the global Camera.WorldToScreen / Camera.ScreenToWorld API use the primary view. Use the SceneCamera component's conversions for a particular output. Each view renders the same world; physics, scripts and animation still update once per frame. Bloom and Scene Render settings on a camera affect its own view.


Combining components (patterns) ​

GoalComponents
Damageable enemyHealth, Stats, Combat Action, Team, Health Bar
Player characterHealth, Stats, Combat Action, Team, Health Bar, Inventory
Animated platformer heroPlatformer Controller + Sprite Renderer + Sprite Animator (autoLocomotionStates on)
AI guardTop-Down/Side-Scroller Controller (controlledBy: ai) + AI Mover
Skill buttonAbility Cooldown + Object Flow on use / canUse
Battle loopTurn Queue on a controller + group-tagged fighters
Collectible coinPickup (auto-adds sensor Collider 2D)
Spikes / damage zonesHazard (auto-adds sensor Collider 2D)
Sticky arrow / boltProjectile + dynamic Rigid Body 2D (CCD on) + Collider 2D
Enemy wavesSpawner pointing at an enemy prefab
Physics propRigid Body 2D + Collider 2D
Static platform / floorCollider 2D only
Hinged door / leverJoint 2D (revolute) between two Rigid Body 2D objects
Death flopHealth + Ragdoll (activateOnDeath on)
Countdown / spawn cadenceTimer driving other actions, or Spawner's own interval
Paint-order groupSorting Group on a parent + Sprite Renderers on children

For custom types authored in the editor, see Behavior Components.

Network Owner (networkOwner) ​

Category: Network

Assigns a Play object to one room player. LocalInput runs only for the client whose player id matches this component's runtime owner, and owner-only network actions are refused before OpalScript executes. Host OpalScript assigns ownership through Network.SetOwner(entity, playerId); room identities are never authored into a project.

Fields ​

FieldTypeDefaultNotes
ownerOnlybooleantrueRequire the requesting player to own this object before any [NetworkAction] executes.

The internal replicated ownerId is intentionally absent from the Inspector. It is cleared when its player leaves or the Play world changes. See Multiplayer and sharing.

Network Input (networkInput) ​

Category: Input

Routes a tap, key or Flow request to an OpalScript [NetworkAction] on this object. The host checks the active method signature and runs its gameplay permission rules. Works in local Play, the editor and exported players; guest scripts remain disabled.

Fields ​

FieldTypeDefaultNotes
componentstringemptyScript component ID, such as crewCrystal.
actionstringemptyExposed method name, such as Hit.
argumentsstring[]JSON array of scalar values in parameter order.
keystringemptyOptional shortcut key.
tapbooleantrueRequest when a tap ends over the object's bounds without dragging.

These fields are inspector configuration and do not generate Flow field accessors. The request action requests the configured method and values through the same host authorization path. There are no additional events or conditions. Network Input grants no native damage, inventory or other gameplay policy itself. See Multiplayer and sharing for script syntax and limits.

General capabilities and tile rendering ​

Proximity Sensor (proximitySensor) ​

Detects nearby objects in a radius or facing cone, with optional group, component and line-of-sight filters. Does not move or attack.

Membership is a snapshot of live object IDs in world space; invisible objects and objects with zero Health can still be sensed. Radius 0 detects coincident origins. The cone faces local +X. Group filters use the canonical group/team query; line of sight uses other Collider 2D footprints. Disable, removal and Stop release membership. It never moves, attacks or initializes physics.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueEnabled
radiusnumber128World-space distance from this object's visual origin. 0 detects only coincident origins.
anglenumber360Cone width in degrees, facing this object's local +X axis. 360 detects all directions.
groupstring""Optional group or team name to detect.
componentstring""Optional enabled component that a detected object must have.
lineOfSightbooleanfalseExclude targets blocked by other Collider 2D footprints.
nearestIdobjectRef""output; Nearest Object
countint0output; Detected Count

Actions ​

  • setEnabled: Enables sensing, or disables it and clears detected IDs and count immediately..

Conditions ​

  • hasTargets: Returns true when the latest scan detected at least one object..

Events ​

  • entered: Emits an object's ID when it first satisfies this sensor's range and filters..
  • exited: Emits an object's ID when it leaves the range or no longer satisfies the filters..
  • nearestChanged: Emits the previous and current nearest object IDs; an empty ID means no detected object..

Resource Meter (resourceMeter) ​

A named bounded numeric resource with exact spending and committed change results.

initialValue is saved configuration; value and fraction are live outputs reset on each Play. Set/Add refuse changes outside the bounds; Spend accepts only finite nonnegative costs and commits exactly or refuses. Commands return immutable ResourceChange records with a signed actual delta and identity. Changed/Empty/Full carry that committed result. Equal minimum and maximum is valid with fraction 0; invalid ranges produce a setup notice and refuse commands.

Fields ​

FieldTypeDefaultNotes
namestring"resource"Name
minnumber0Minimum
maxnumber100Maximum
initialValuenumber100Initial Value
valuenumber100output; Value
fractionnumber1output; Fraction

Actions ​

  • set: Set an exact value within the authored range, or return a refusal without changing it..
  • add: Apply an exact signed amount, refusing changes outside the authored range..
  • spend: Subtract a finite nonnegative cost only when the entire cost is available..
  • refill: Set the resource to its authored maximum and return the committed change..

Conditions ​

  • isEmpty: True when the current value equals a valid authored minimum..
  • isFull: True when the current value equals a valid authored maximum..
  • canSpend: True when a finite nonnegative cost can be spent in full without crossing the minimum..

Events ​

  • changed: Emitted after an accepted command commits a new value..
  • empty: Emitted when an accepted change reaches the minimum from above..
  • full: Emitted when an accepted change reaches the maximum from below..

Transform Constraint (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.

Targets are stored as IDs and resolved in the current world. World offsets use world units; local offsets follow the target axes and scale. Rotation offsets are radians. Smoothing 0 snaps; positive values are an exponential response rate per second. Cycles and enabled physics/controllers or overlapping Motion operations refuse pose writes with a diagnostic. Stop restores the starting local pose. Use parenting when every channel should inherit together.

Fields ​

FieldTypeDefaultNotes
enabledbooleantrueEnabled
targetobjectRef""Target
copyPositionbooleantrueCopy Position
copyRotationbooleanfalseCopy Rotation
copyScalebooleanfalseCopy Scale
offsetXnumber0Offset X
offsetYnumber0Offset Y
offsetSpaceenum"world"World units, or target-local units rotated and scaled with the target.
rotationOffsetnumber0Additional world rotation in radians.
scaleMultipliernumber1Scale Multiplier
smoothingnumber0Exponential response rate per second. 0 snaps to the target; positive values approach it smoothly.
activebooleanfalseoutput; Active
diagnosticstring""output; Diagnostic

Actions ​

  • setTarget: Sets the object whose world pose will be copied on the next update..
  • clearTarget: Clears the target and stops copying its pose without moving this object..
  • setEnabled: Enables or disables pose copying without changing this object's current pose..

Conditions ​

  • isActive: Returns true when the latest update copied the target pose without a conflict or invalid reference..

Audio Emitter (audioEmitter) ​

Owns one sound voice. Play, loop and stop it with volume, pitch and stereo pan.

One emitter owns one voice from the canonical audio service. Repeated Play replaces it. Stop, disable, removal and world retirement abort delayed asset/decode work and release playback. Loop uses the same voice; volume (0–2), pitch (0.01–4) and stereo pan (−1–1) are live controls. Playing/Status are outputs. Missing/unavailable sounds fail without starting a voice; the next Play uses current asset bytes after a rebake. There is no automatic distance attenuation.

Fields ​

FieldTypeDefaultNotes
soundassetRef""Sound
autoPlaybooleanfalsePlay on start
loopbooleanfalseLoop
volumenumber1Volume
pitchnumber1Pitch
pannumber0Stereo pan
playingbooleanfalseoutput; Playing
diagnosticstring""output; Status

Actions ​

  • play: Replace this emitter's voice with the configured sound; playback status updates after loading..
  • stop: Cancel pending loading and stop this emitter's voice..

Conditions ​

  • isPlaying: Whether the owned sound voice is playing..

Events ​

  • started: A sound voice was admitted and started..
  • stopped: The owned voice was stopped explicitly, disabled or released..
  • finished: The owned voice ended naturally..

Value Bar (valueBar) ​

Draws a world-space bar for any numeric field or computed getter, or a directly supplied value.

Empty Source Component uses the direct Value, which Flow or SetValue can update. Otherwise choose an object ID (empty means this object), component ID and declared numeric field or computed getter, such as resourceMeter.value or health.hp. Minimum/Maximum are explicit display bounds. Missing, dead, disabled or mistyped sources hide the bar and expose a diagnostic; valid sources recover automatically. Fractions clamp without rewriting the source. The bar follows pivot-aware world transforms and uses Render2D track/fill commands with a Canvas compatibility fallback. Vertical fill grows upward.

Fields ​

FieldTypeDefaultNotes
valuenumber0Used when Source Component is empty; writable from Flow.
minnumber0Minimum
maxnumber100Maximum
sourceObjectobjectRef""Empty reads this object.
sourceComponentstring""Source component
sourceFieldstring"value"Source field
widthnumber80Width
heightnumber8Height
offsetXnumber0Offset X
offsetYnumber-24Offset Y
directionenum"horizontal"Fill direction
fillColorcolor"#5dd17a"Fill
bgColorcolor"#1a1f29"Background
visiblebooleantrueVisible
showWhenFullbooleantrueShow when full
fractionnumber0output; Fraction
availablebooleanfalseoutput; Source available
diagnosticstring""output; Status

Actions ​

  • setValue: Set the direct value used when Source Component is empty..
  • show: Show the bar when its numeric source is available..
  • hide: Hide the bar..

Conditions ​

  • isAvailable: Whether the current declared numeric source and display range are valid..

Sequence Queue (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.

Authored Items seed a private runtime queue on Play; commands do not rewrite that list. At most 256 active plus pending occurrences are admitted. Duplicated IDs are valid occurrences. Remove removes the active occurrence first, otherwise the first pending occurrence; removal does not advance automatically. Next ends the active occurrence and starts the next; Repeat requeues the ended occurrence. Clear resets position to −1. Destruction does not silently skip a job. Immutable command results and item events report the committed snapshot; eligibility and victory stay in project logic.

Fields ​

FieldTypeDefaultNotes
itemslist[]Initial Items
repeatbooleanfalseRequeue each ended item at the tail when Next is called.
autoStartbooleanfalseStart on play
activeIdstring""output; Active Item
positionint-1output; Zero-based number of items started since Play/reset. -1 before the first item.
queuedCountint0output; Active plus pending occurrences.

Actions ​

  • enqueue: Append one ID occurrence, refusing empty IDs or a queue of 256 occurrences..
  • remove: End the active matching occurrence first, otherwise remove the first matching pending occurrence..
  • next: End the active occurrence and start the next, optionally requeuing the ended occurrence at the tail..
  • clear: End the active occurrence, discard pending occurrences, and reset the started-item position..

Conditions ​

  • isEmpty: True when no active or pending occurrence remains..
  • hasActive: True when a sequence occurrence is currently active..

Events ​

  • itemStart: Emitted after Next commits a new active occurrence..
  • itemEnd: Emitted when Next, Remove, or Clear ends an active occurrence..
  • empty: Emitted after the queue becomes empty, or Next finds no remaining occurrence..

TileMap 2D (tileMap2d) ​

Paints a camera-culled 2D grid from a tile atlas or fitted standalone image. Includes runtime cell editing for procedural levels.

Cells and palette are authored tile data; the renderer visits only the visible cell window. Changes are normalized at the field-change boundary, rather than rescanning the whole map on every render. Render cost still depends on visible commands, material and backend; this is not a total frame-time guarantee.

Fields ​

FieldTypeDefaultNotes
tilesetassetRef""Tile atlas or standalone image painted by this map.
tilesetSourceenum"atlas"Slice a tile atlas into cells, or fit the entire image into each painted tile.
tileWidthint32Tile Width
tileHeightint32Tile Height
marginint0Atlas Margin
spacingint0Tile Spacing
imageFitenum"contain"Contain preserves the whole image; Cover fills the tile; Stretch fills without preserving aspect; Crop keeps original pixel size.
smoothingbooleanfalseEnable bilinear sampling. Leave off for crisp pixel art.
opacitynumber1Opacity
collisionEnabledbooleantrueBuild efficient merged physics colliders from cells whose source tile is marked Solid.
collisionFrictionnumber0.7Friction
collisionRestitutionnumber0Bounce
collisionContactSkinnumber0Contact Skin
mapWidthint16Columns
mapHeightint10Rows

Actions ​

  • setCell.
  • eraseCell.
  • fillRect.
  • floodFill.
  • setTileSolid.
  • clear.

Conditions ​

  • cellIs.
  • cellIsEmpty.
  • cellIsSolid.
  • worldPointIsSolid.

Events ​

  • cellChanged.
  • mapCleared.
  • tileCollisionChanged.
  • collisionStart.
  • collisionEnd.

Runtime admission details: Spawner consumes its count/limit only for admitted creation. Projectile-mode Ranged Weapon consumes its cooldown only for admitted creation. Both require a prepared prefab plan; spawnRefused / fireRefused report unavailable or refused requests. Hitscan still emits Fired for a valid shot; Hit reports only an accepted Health change. Timer delivers at most 128 elapsed looping cycles per tick, carrying any backlog; reentrant Stop, Restart or duration changes interrupt the current catch-up pass.