Physics¶
Sektor simulates rigid bodies, triggers, queries, and characters with Jolt Physics (the engine behind Horizon Forbidden West), pinned behind Sektor's own adapter: no Jolt types ever appear in your project files, the AI protocol, or the editor. Simulation runs on the fixed tick with double-precision positions, so results are deterministic and replay-safe.
Components¶
Collider¶
| Field | Notes |
|---|---|
shape |
box, sphere, or capsule |
boxHalfExtents / capsuleHeight and radius fields |
Shape dimensions |
center |
Local offset from the entity origin |
trigger |
Overlap volume instead of solid collision |
collisionLayer, collisionMask |
Who I am, and who I collide with |
Rigid Body¶
| Field | Notes |
|---|---|
motion |
static, dynamic, or kinematic |
massKilograms |
Dynamic mass |
friction, restitution |
Surface grip and bounce |
linearDamping, angularDamping |
Velocity decay |
gravityFactor |
1 is normal gravity, 0 floats |
continuousCollision |
Anti-tunneling for fast movers |
allowSleeping |
Let resting bodies sleep |
Character Controller¶
The capsule character mover is documented in Gameplay & Controls. It lives on the same fixed tick and pushes dynamic bodies using characterMassKilograms.
World geometry is shared¶
The newest addition: one runtime geometry source now feeds both physics and navigation.
- Generated Terrain automatically derives a physics heightfield. Characters and bodies collide with the exact sculpted surface, no extra setup.
- Static geometry cooks asynchronously with deterministic, content-hashed results, and the same triangles that physics stands on are what the navmesh bakes from.
The practical consequence: what the player sees, what physics collides with, and what agents path across cannot silently disagree, because they come from one source with one deterministic ordering.
Collision events¶
Event Sheets get physics.on_collision_enter / stay / exit and physics.on_trigger_enter / stay / exit. They execute once per matching occurrence, pick both participants (object and other), and expose oriented contact expressions: collision.self, collision.other, collision.point, collision.normal. Exit occurrences keep their last contact data for one tick, so departure logic still knows where things happened.
Physics steps between input sampling and Event evaluation, so a contact created by movement is visible in the same tick that caused it.
Pressure plate
Event 1, trigger physics.on_trigger_enter between Crate and Plate:
set the picked Plate emissive on, audio.play a click, send custom event DoorOpen.
Event 2, trigger physics.on_trigger_exit between Crate and Plate: reverse it.
Only the plate under the crate reacts, because both participants are picked.
Queries and forces¶
Raycasts, sphere casts, and layer-filtered queries are available to gameplay, and dynamic bodies accept impulses. Contacts arrive deterministically sorted, so "first hit" means the same thing in every replay and on every machine.
Recipe: physics-driven crates¶
- Place a few cube models on your terrain.
- Add Component → Collider (box halves matching the model) and Rigid Body (
dynamic, 20 kg). - Duplicate with
Ctrl+Dand stack them. - Press Play and walk into the stack. The character pushes crates with its mass; crates tumble on the exact terrain heightfield.
- Add a trigger at the cliff edge: a collider with
triggerenabled. Event:on_trigger_enterwithCrate, action destroy the picked crate and add 1 to aCratesLostvariable.
Automate it¶
{"op":"component.add","id":7,"type":"collider"}
{"op":"component.add","id":7,"type":"rigid_body"}
{"op":"runtime.play"}
During Play, collision occurrences, character telemetry, and diagnostics land in the same snapshot the AI reads, so "did the crate actually fall" is a query, not a guess.