Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 0fc7535e-6…

FlashFire

FlashFire fires an effect from in front of the player, away from the camera the player looks through, while the player presses or holds `fire`. It sits on the player's body: the peer that owns the body reads the control and aims the shot, and every peer plays it, because `shoot`…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

FlashFire

FlashFire fires an effect from in front of the player, away from the camera the player looks through, while the player presses or holds fire. It sits on the player's body: the peer that owns the body reads the control and aims the shot, and every peer plays it, because shoot is a synced function.

The gun has one effect of its own, standing at its muzzle as a child of the body. A shot moves it to where the muzzle is, turns it down the aim and plays it again from its start, so a body firing any number of shots holds one effect, and each body in the world holds its own.

The main scene uses it on the body entity of DefaultSocialPlayer, the PlayerPrototype under PlayerSetups, with effect set to effects.combat.muzzleFlash and inputMap set to weapon.weapon. It aims with the Camera of the CameraRig entity whose follow is this body.

Fields

FieldTypeDefaultDescription
effectassetRef (procGraph)effects.combat.muzzleFlashThe effect fired on each press.
inputMapassetRef (inputMap)weapon.weaponThe controls live while this peer's player owns the body. fire is the one that shoots.
aheadnumber0.8How far in front of the body, along the aim, the effect fires from, in metres.
heightnumber1.4How far above the body's origin the effect fires from, in metres.
sidenumber0.35How far to the right of the body, across the aim, the effect fires from, in metres: where a gun in the right hand is.
ratenumber11Shots per second while fire is held down. A press fires at once; holding it keeps firing at this rate.

All fields are Sync.

Methods

  • :shoot(at, dir): plays the effect at at (a world position { x, y, z }), pointing along dir (a world direction { x, y, z }), on this peer. It is declared in syncedFunctions, so a call plays the shot on every peer. It makes the muzzle effect on first use (a temporary child entity named muzzle with a Generator for effect, playOn = "manual"), and makes it again when effect names another asset. It moves the muzzle to at, turns its forward (-Z) onto dir, seeks the Generator to the first frame of its playback and plays it.

Lifecycle

  • update(dt): on the peer that owns the body, while the engine runs unpaused, it activates inputMap and listens to its fire control: a press fires one shot at once and holds the trigger, a release lets go. Elsewhere, and while paused, it deactivates the map and lets go of the trigger. While the trigger is held and rate is above 0, it accumulates dt * rate shots (held at most 2, so a hitch adds at most one extra shot) and fires one per whole shot owed.
  • onDestroy(): deactivates the input map and despawns the muzzle effect.

A shot finds the aim camera and places the effect at the body's position plus ahead along the camera's forward, side along its right and height up, then calls shoot with that position and the camera's forward.

If the input map raises an error on activation or deactivation, FlashFire reports it with warn.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

component

Generator

aimCamera( ) → any

The camera this peer's player looks through: the one following this body.

dropMuzzle( ) → void

muzzleEffect( ) → any

The muzzle's Generator, made on this peer the first time it is needed and made again when `effect` names another asset.

facing(dir: { x: number, y: number, z: number }) → any

A rotation that turns forward (-Z), the way the effect's bore runs, onto `dir`.

argtypedescription
dir{ x: number, y: number, z: number }

fire( ) → void

shoot(at: { x: number, y: number, z: number }, dir: { x: number, y: number, z: number }) → void

Play the effect at `at`, pointing along `dir`, on this peer.

argtypedescription
at{ x: number, y: number, z: number }The world position the effect plays at.
dir{ x: number, y: number, z: number }The world direction it points.

takeControls( ) → void

dropControls( ) → void

update(dt: number) → void

argtypedescription
dtnumber

onDestroy( ) → void

⌬ Metadata
descriptionFires an effect from in front of the player's body along the camera's aim while the fire control is pressed or held, synced to every peer.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · weapon/FlashFire.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.