Skip to main content

fireShooter2DIfRequested

@zylem/game-lib


@zylem/game-lib / behavior / fireShooter2DIfRequested

Function: fireShooter2DIfRequested()

fireShooter2DIfRequested(entity, shooter, stage, input, aim?): boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/shooter-fire-DGripl0z.d.ts:53

Fire the entity's Shooter2D behavior when the input requests it.

Resolves the 2D aim (explicit aim axes, falling back to the entity's current facing) and fires toward a point one unit along the aim direction. Pass a pre-resolved aim to avoid recomputing when the coordinator already resolved it for rotation.

Parameters​

entity​

Shooter2DSourceEntity

shooter​

Shooter2DHandle

stage​

Shooter2DStageLike

input​

Shooter2DAimFireInput

aim?​

ResolvedAim2D

Returns​

boolean

true when a fire attempt was issued