Recipes
Jump pad bounce pad launcher and springboard
The player walks onto a pad and is flung up (or forward) into the air: a bounce pad, a springboard, a launcher, a trampoline, a knockback plate. The engine has no JumpPadComponent and never did; the pad is a trigger plus a script that issues a physics launch command to whoever entered.
engine v1.0.234since script-semantic-patch-ops.v1, action-catalog.v1.0.232, physics.v1, mutation.v1Copy for LLM
Use this for
a pad the player steps on that flings them upward or forward; bounce pads, launch pads, springboards, trampolines, knockback plates, and any "step here and get launched" surface
Not for
a platform that carries the player while they stand on it (see moving-platforms-and-elevators); teleporting the player to another location (see teleporters-and-portals); the player's own jump on a key press (see third-person-and-platformer-movement)
Pairs with: Physics colliders rigid bodies triggers and joints, Third-person follow camera and platformer jump movement, Event wiring one trigger emits another responder reacts, Audio sound effects music and positional feedback
The recipe
Author with project_apply_script_semantic_patch using the ai_safe op pack.
- Give the pad a trigger
ColliderComponent(collision:"trigger") sized to the pad surface, viaproject_add_component. Asolidcollider would block the player instead of detecting the step-on. - Add the launch handler with
addTriggerHandler({ "handlerKey":"onLaunch" }). Author the body as whole-body GessaScript throughreplaceScriptFromGessaScript. - Inside the handler the entering entity is
event.other(aRuntimeEntitySnapshot); its id isevent.other.id. Launch it:ctx.physics.command(event.other.id, { type: "launch", velocity: { x: 0, y: 12, z: 0 } }).launchSETS the character's linear velocity, which is the one sanctioned way to fling a kinematicCharacterMovementComponentbody from a script. - Gate to players so a stray prop does not trip the pad: check
event.other.tags(e.g.if (event.other.tags.includes("player"))) before the command, or filter by a component you know only the player carries viactx.entity.readComponent. - Directional launch (a ramp that throws the player forward): set the horizontal components too, e.g.
velocity: { x: 0, y: 9, z: 14 }. Keep a positiveyso the arc clears the pad. - Feedback:
ctx.audio.playa spring/boing clip in the same handler so the launch reads.
Pitfalls
- Do NOT
ctx.entity.patchComponentthe player'sTransformComponentto fake a jump: teleporting the position fights prediction and the character controller.ctx.physics.commandwithlaunchis the only correct lane. - A
solidcollider on the pad blocks the player; the detector must be atriggercollider. Keep the visible pad mesh and the trigger volume aligned. launchREPLACES velocity rather than adding to it, so a tinyygives a weak hop regardless of incoming speed; tune theymagnitude, not the collider.- Launch the ENTERING entity (
event.other.id), never the pad itself; commanding the pad's own id does nothing useful and the player keeps walking.
Verify
simulation_run(qa.run.start) driving the player onto the pad and asserting the resulting upward velocity / peak height.project_get_graph_snapshotto confirm the triggerColliderComponentand the trigger handler landed on the pad entity.