Recipes
Game feel juice hit flash camera kick and impact
Hits land flat and actions feel weak. Juice is the layer of flash, kick, particles, and sound on the contact moment. It is script-authored feedback on top of the real gameplay effect, not a component you attach.
engine v1.0.234since script-semantic-patch-ops.v1, action-catalog.v1.0.232, rendering.v1, camera.v1, audio.v1, mutation.v1Copy for LLM
Use this for
making hits and actions feel punchy; a flash and camera kick on impact; recoil; impact particles and a punchy sound; juicy feedback and polish on contact moments
Not for
the damage or health math itself (see combat-damage-and-respawn); the particle system setup (see particles-and-visual-effects); global color grade and post look (see camera-feel)
Pairs with: Combat damage health and respawn scripting, Particles explosions and visual effects, Projectiles bullets and ranged weapons, Camera feel field of view smoothing tone mapping and post
The recipe
Author with project_apply_script_semantic_patch using the ai_safe op pack; the feedback runs in the same handler that resolves the hit.
- Hit flash: on impact,
ctx.entity.patchComponentaHighlightComponent(enabled:true, a brightcolor, highfillOpacity) on the struck entity for a moment then off, or pulse aLightComponentmodulation(mode:"pulse") for a bloom of light. - Impact burst: fire a
ParticleEmitterComponentburst at the contact point (see particles-and-visual-effects) for sparks, dust, or a puff. - Punchy sound:
ctx.audio.playthe hit cue withAudioPlayOptions, jitteringpitchslightly per hit and settingvolumeso repeated hits do not sound identical (see audio-feedback). - Camera kick / recoil:
ctx.camera.addLookInputa small delta to nudge the view on the shot or hit, then let it settle. This is the recoil kick and the closest thing to a shake. - Brief pause feel (pseudo-hitstop): there is no time-dilation op; approximate by gating the actor's own update with a
setBooleanStatefrozenflag for a few ticks so it visibly hitches, then clearing it.
Pitfalls
- There is NO native
screenShakeorhitstophost op (that is Spawn vocabulary). Approximate a shake with a short oscillatingctx.camera.addLookInputkick, and a hitstop with a state-gated pause; do not expect a one-call effect. - Only ENABLED highlights count against the per-tier highlight budget; turn the flash off after its moment so it does not linger or blow the budget.
- Keep juice on the authority path that already resolves the hit so feedback and damage stay in sync across clients.
- Juice is feel, not gameplay; the flash and kick must not change the actual damage, hitbox, or outcome (see combat-damage-and-respawn).
Verify
simulation_run(qa.run.start) to confirm a hit triggers the flash, burst, sound, and kick together.qa_capture_renderer_viewport(qa.renderer.viewport.capture) to see the flash and impact read on screen.