Recipes
Teleporters portals and warp pads
The player steps on a pad and reappears elsewhere, or walks through a portal to another level. Same-world jumps patch the player transform; cross-world portals use the dedicated teleport host op that issues a room handoff.
engine v1.0.234since script-semantic-patch-ops.v1, action-catalog.v1.0.232, worlds.v1, physics.v1, mutation.v1, prefabs.v1Copy for LLM
Use this for
a pad or door that warps the player to another spot in the same level; portals that send the player to a different world or room; return-to-lobby and level-exit warps
Not for
matchmaking room assignment on join (see multiplayer-replication-and-rooms); checkpoints that only record a respawn position (see spawn-points-and-checkpoints); a door that swings open in place (see doors-buttons-and-interactions)
Pairs with: Spawn points checkpoints and respawn flow, Doors buttons levers and press-to-interact, Multiplayer replication rooms and networked motion, Hazards lava damage zones and water
The recipe
Author with project_apply_script_semantic_patch using the ai_safe op pack.
- Build the pad: an entity with a trigger
ColliderComponent(collision:"trigger") over the step zone, andaddTriggerHandler{ "handlerKey":"onWarp" }. - Same-world jump: in the handler body (whole-body GessaScript via
replaceScriptFromGessaScript),ctx.entity.patchComponentthe entering player'sTransformComponentpositionto the destination coordinates. Read a destination stored in state withreadTypedStateValueif it is dynamic. - Cross-world portal: call
ctx.world.teleportPlayerwith the player id and the target world key. This is gated byworlds.teleport_authorityand writes a teleport handoff into the warehouse, which the destination room admits; the player is not simply moved in place. - Face the exit: set the arrival
rotationtoo, so the player looks into the new area rather than back at the pad they arrived on. - Prevent immediate re-trigger: place the destination outside the source pad's trigger volume, or set a short cooldown boolean so arriving does not bounce the player straight back.
Pitfalls
ctx.world.teleportPlayeris for player entities across worlds; for moving a fresh non-player entity use spawn (see spawn-points-and-checkpoints). For a same-world player nudge, patch theTransformComponentinstead.- Teleport is authority-gated and asynchronous through a warehouse handoff; do not assume the player is at the destination on the same tick you call it.
- Two pads that warp into each other's trigger zones cause an infinite bounce. Offset arrival points and add a re-entry cooldown.
- A
solidcollider blocks the player off the pad; the pad must betrigger.
Verify
simulation_run(qa.run.start) to prove stepping on the pad relocates the player and, for portals, that the destination world admits them.project_get_graph_snapshotto confirm the pad's trigger collider and warp handler exist.