Skip to main content

Components

Polygon Engine scenes are built from GameObjects. Every GameObject has a Transform, and optional components add rendering, gameplay, collision, audio, camera, lighting, animation, and scripting behavior.

The component model is intentionally small. Each component should serialize cleanly to scene JSON, validate in the editor, and stage predictably into the PS1 runtime.

Component Families

FamilyComponents
CoreTransform, Mesh Renderer, Camera, Lua Behaviour
Collision and movementCollider, Character Controller
Native player stackPlayer Input, Player Motor, First Person Controller, Third Person Controller, Camera Rig
InteractionInteraction Ray, Interactable, Spawn Point
PresentationDirectional Light, Transform Animator, Animator, Player Animator, Audio Source, Particle System
WorldRoom, Portal, NavMesh Surface, Navigation Modifier, NavMesh Agent
UIAuthored UI Canvases, Text, Button, Image, Panel, ProgressBar, bitmap fonts

UI elements are stored in the scene's named UI canvases, not as GameObject components. See UI Canvas.

Transform

Present on every GameObject.

PropertyDescription
PositionLocal position relative to the parent
RotationLocal Euler rotation in degrees
ScaleLocal scale
ParentOptional parent GameObject

Child transforms are resolved into world transforms before rendering, collision, camera, and script queries.

Mesh Renderer

Draws either a built-in primitive or an imported mesh asset.

PropertyDescription
Mesh Typebuiltin or asset
MeshBuilt-in primitive name or imported mesh GUID
Material TypeBuilt-in material or material asset
MaterialBuilt-in name or material GUID
Primitive TessellationSegment controls for compatible built-in primitives
Vertex Color ModeMaterial, Mesh Vertex Colors, GTE Vertex Lighting, or Flat Color
Flat ColorRenderer color override used by Flat Color mode
Receive FogParticipate in the PS1 per-vertex distance-fog blend
Renderer RoomOptional Room GameObject used by room-connectivity rejection

Built-in primitives include Cube, Plane, and Capsule. For PS1 builds, static built-in Plane and Cube geometry can be baked into safer staged mesh chunks. Rounded primitives should be used sparingly in PS1-facing scenes.

Mesh Vertex Colors and GTE Vertex Lighting use native Gouraud G3/GT3 primitives on supported paths. GTE Vertex Lighting is evaluated at runtime from mesh normals; it is not an offline lighting bake.

Camera

Defines a render viewpoint.

PropertyDescription
FOVField of view in degrees

The runtime uses an enabled camera or a camera driven by a CameraRig/player setup.

Lua Behaviour

Attaches a Lua script file to the GameObject.

PropertyDescription
Script PathRelative path to a .lua file
Script PropertiesInspector-exposed key/value strings passed to the script

Engine lifecycle callbacks use exact PascalCase names:

  • Awake, OnEnable, Start, FixedUpdate, Update, and LateUpdate;
  • OnCollisionEnter, OnCollisionStay, and OnCollisionExit;
  • OnTriggerEnter, OnTriggerStay, and OnTriggerExit;
  • OnDisable and OnDestroy.

Buttons, Interactables, Timelines, and GameObject.Invoke call custom Lua functions by their exact configured name. Those functions are project-defined and are not lifecycle aliases.

See Lua API Overview.

Collider

Defines a collision volume for blocking and triggers.

PropertyDescription
TypeBox or sphere
Size / RadiusShape dimensions
Is TriggerOverlap only, no blocking response

Colliders are used by collision callbacks, trigger callbacks, interactables, pickups, stations, and blocking world geometry.

Level Builder scene placement creates an AABB Collider for the placed mesh. Tune it in the Inspector if the generated bounds are too broad or too narrow.

The PS1 runtime uses a fixed-capacity sweep-and-prune broad phase for active Collider pairs, then runs normal shape tests on the resulting candidates. Invalid or unavailable broad-phase state falls back conservatively to the full pair path. This optimization requires no project setting and does not change collision or trigger callbacks.

Character Controller

High-level locomotion collider for player-style movement.

PropertyDescription
HeightCapsule height
RadiusCapsule radius
Step OffsetSmall step climbing
Slope LimitMaximum traversable slope
Skin WidthCollision padding
Use GravityApply gravity through the controller

Use Character Controller for first-person and third-person player movement instead of manually translating through world Colliders.

Step, ground, and slope tests sample the true upper plane of rotated box Colliders. Step Offset controls small upward rises and Slope Limit rejects steeper top faces. This is controller-specific surface handling, not a general rigid-body OBB solver or moving-platform system.

Player Input

Maps pad input into movement, look, run, and interaction actions. Movement uses the left stick or D-Pad. Camera look uses the right stick when an analog pad is available. The native player stack does not repurpose shoulder or trigger buttons as camera axes.

PropertyDescription
SchemeFirstPerson, ThirdPersonTank, or ThirdPersonCameraRelative
Move ActionNamed movement axis
Look ActionNamed look axis
Run ButtonButton name, default Circle
Interact ButtonButton name, default Cross
Look Sensitivity X/YCamera/controller sensitivity
Invert Look YInvert vertical look
Dead ZoneAnalog dead zone

Use Player Input with Player Motor and one controller component. In DuckStation, select a Digital Controller for D-Pad-only projects, or an Analog/DualShock controller with analog mode enabled for right-stick camera input.

Player Motor

Controls core movement values used by native player controllers.

PropertyDescription
Move SpeedNormal movement speed
Run SpeedRunning speed
Turn SpeedRotation speed
GravityGravity strength
AccelerationMovement acceleration
Allow RunEnables run input
Use GravityApplies gravity through the motor/controller stack

First Person Controller

Adds first-person camera behavior to a player GameObject.

PropertyDescription
Eye HeightCamera height above the player base
Lock Cursor On PlayEditor play-mode behavior
Head BobOptional camera bob
Head Bob AmountBob intensity

Typical setup: Player Input, Player Motor, Character Controller, First Person Controller, Camera Rig, and an Interaction Ray.

Third Person Controller

Adds third-person movement behavior.

PropertyDescription
Control SchemeTank or camera-relative movement
Camera DistanceFollow distance
Camera HeightFollow height
Use Camera ZonesAllows CameraZone overrides

Typical setup: Player Input, Player Motor, Character Controller, Third Person Controller, Camera Rig, a visible Mesh Renderer, and optional Player Animator.

Camera Rig

Controls a camera relative to a target GameObject.

PropertyDescription
ModeFirstPerson, ThirdPersonFollow, ThirdPersonOrbit, or Fixed
Target GameObject IDGameObject to follow or orbit
OffsetLocal camera offset
Eye HeightFirst-person camera height
Distance / HeightThird-person placement
Follow SmoothFollow smoothing
Collide With WorldCamera collision option
Pitch Min / MaxVertical look limits

Camera Zone

Defines a volume that can override camera behavior.

PropertyDescription
ModeFixed, Follow, or Orbit
Camera GameObject IDCamera or rig target
PriorityHigher priority wins
SizeZone bounds
Cut On EnterInstant switch instead of blend
Blend TimeTransition time

Camera zones are most useful in third-person scenes.

Interaction Ray

Lets a player query interactable objects in front of them.

PropertyDescription
Cast ModeRay or sphere
DistanceInteraction reach
RadiusSphere cast radius
PromptPrompt text
Target GameObject IDOptional explicit target
Function NameExact custom Lua function to call, commonly interact
Require Line Of SightBlocks interaction through geometry

Interactable

Marks a GameObject as an interaction target.

PropertyDescription
EnabledInclude the target in interaction queries and prompts
PromptText shown to the player
Function NameLua Behaviour function invoked by interaction
RadiusInteraction radius
ButtonTarget-specific button, or inherit Player Input.Interact Button
CooldownSeconds before the target can be used again, 0..3600
RepeatableAllow later interactions; when off, consume after the first accepted activation
Prompt CanvasOptional named canvas shown while this target is in range

Supported target-specific names are Cross, Circle, Square, Triangle, L1, L2, R1, R2, L3, R3, Start, and Select. Interaction uses the button's pressed edge, not a continuously held state. When Prompt Canvas is empty or cannot resolve, the runtime displays its built-in Button: Prompt text. Pair Interactable with a Lua Behaviour component when the object should react to player input. Lua can temporarily disable or re-enable the component through the Interactable API.

Spawn Point

Defines where player-style systems should spawn or respawn.

PropertyDescription
Spawn IDNamed spawn point
Default SpawnUsed when no specific spawn is requested

Particle System

Emits deterministic bounded billboard particles from authored settings.

PropertyDescription
Enabled / Play On StartRuntime participation and automatic startup
Loop / Duration / Start DelayEmitter timing
RateParticles per second, capped at 60
LifetimeMinimum and maximum particle life
Local OffsetEmission origin relative to the GameObject
Velocity / RandomnessBase and per-axis randomized velocity
Color8-bit RGBA particle tint
SeedDeterministic random sequence

The Dust, Sparks, and Steam presets provide PS1-safe starting points. The Inspector estimates peak occupancy against the shared 32-particle pool. Lua's ParticleSystem.Emit is the global one-shot path; it does not start or stop an authored component.

Audio Source

Plays a VAG-backed audio clip through the PS1 SPU.

PropertyDescription
Audio ClipImported WAV converted to .vag
VolumePlayback volume
LoopWhether playback loops
Play On StartStart automatically when the scene loads

Audio is scene-resident. Imported clips must fit the runtime audio budget. Long background music should normally use Streaming Music (CD-XA) and the global Music Lua API instead of an Audio Source.

Directional Light

Adds directional lighting data.

PropertyDescription
DirectionMain light direction
ColorDirectional light color
IntensityDirectional contribution multiplier
AmbientAmbient contribution

The PS1 runtime uses a limited directional lighting path. Keep lighting simple and motivated.

Transform Animator

Controls named transform animation states on a GameObject.

PropertyDescription
StatesNamed animation states
Default StateState played initially
SpeedPlayback speed
LoopWhether playback loops
Play On StartStart automatically

Lua can play, stop, set speed, query state, and change animation state through the TransformAnimator API. This component animates transform states; it is not the imported skeletal component.

A scene supports at most 32 Transform Animator components and four states per component. The PS1 runtime assigns state storage from a deterministic component pool only for GameObjects that own this component, instead of reserving four state records inside every scene GameObject. Validation blocks scenes that exceed either limit.

Animator

Plays clips imported from a hard-skinned FBX asset.

PropertyDescription
EnabledParticipate in update and rendering
SkinImported .skn asset
Default ClipInitial named clip
Playback SpeedClip time multiplier
LoopRestart after the final frame
Play On StartStart the default clip automatically

The GameObject also uses its Mesh Renderer material and texture. See Skeletal Animation for import, hard-skin behavior, limits, and Animator playback.

Player Animator

Maps native player movement states to Transform Animator state names.

PropertyDescription
Idle StateTransform Animator state for idle
Walk StateTransform Animator state for walking
Run StateTransform Animator state for running
Interact StateTransform Animator state for interaction
Speed DampDampening for state changes

Use this with Third Person Controller or any visible player representation that needs state-driven transform animation.

Room and Portal

Room defines an axis-aligned named volume with offset and overlap priority. Portal references two Rooms and controls directed visibility connectivity with enabled, open, and two-sided state. Portal state can change through Portal.SetOpen().

The PS1 runtime admits the first room behind each adjacent valid opening, then uses conservative aperture-cone overlap for later Portal traversal. Ambiguous data fails open. Editor Play Mode and PS1 share the aperture-cone tests for equivalent scene/camera state. This remains a conservative visibility system rather than exact portal-plane or hardware occlusion. See Rooms, Portals, and Navigation.

NavMesh Surface describes a bounded height-aware graph bake with X/Z Cell Size, vertical Cell Height, agent clearance, Max Step, Max Slope, and Max Drop. It supports surface Y rotation and deterministic four-neighbour links. Multiple height samples may exist at one X/Z coordinate.

Navigation Modifier classifies a root Collider as Obstacle, Walkable, Platform, or WalkOff. Walkable/Platform require solid box Colliders and sample their true rotated upper face. WalkOff requires a trigger and permits bounded one-way descents. Platform remains static bake data; it does not implement moving platforms. Ordinary obstacle geometry remains root and yaw-only for the bake.

NavMesh Agent references a surface and stores speed, acceleration, stopping distance, and rotate-to-velocity behavior. Agents must remain root GameObjects because baked paths and runtime movement use world-space positions. Agent path queries are filtered to the referenced surface.

Use the NavMesh Lua API to request paths and move agents.