Legacy Reference

Weapon Nodes

Flow Graph is deprecated and will be removed in a future version of Lumberyard. Learn about Script Canvas, Lumberyard's new visual scripting environment.

This topic references tools and features that are legacy. If you want to use legacy tools in Lumberyard Editor, disable the CryEntity Removal gem using the Project Configurator or the command line. To learn about the latest features, see the Amazon Lumberyard User Guide.

You can use the following flow graph nodes to configure weapon settings.


These nodes will only work with the Legacy Game Sample (CryEngine GameSDK), which is available at Lumberyard Downloads.

AmmoChange node

Used to give or take ammunition to for from the player. Weapon and ammo type must match.


Port Type Description
Set Any Activates the node
Get Any Retrieves the amount of ammunition left
AmmoType String Type of ammunition to add
AmountCount Integer Gets the amount of ammunition left
Add Boolean Adds the specified amount of ammunition


Port Type Description
MagazineAmmo Integer Ammunition left in the weapon magazine
InventoryAmmo Integer Ammunition left in inventory
TotalAmmo Integer Total ammunition available

AutoSightWeapon node

This node


Port Type Description
Enemy Vec3 Aims the weapon at the enemy's position

ChangeFireMode node

Used to change the weapon fire mode.


Port Type Description
Switch Any Switches the weapon fire mode

FireWeapon node

Use to fire a weapon and set a target entity or a target position.


Port Type Description
TargetId Any Target ID
TargetPos Vec3 Target position
AlignToTarget Boolean Aims the weapon at the target
StartFire Any Starts firing weapon
StopFire Any Stops firing weapon
NumberOfShots Integer Fires the specified number of shots
Accuracy Float Specifies firing accuracy from 0% to 100%


Port Type Description
FireStarted Boolean Triggers when firing starts
FireStopped Boolean Triggers when firing stops

Listener node

Use to listen on WeaponId or player's WeaponClass, or as a fallback on the current player's weapon and to trigger OnShoot when shot.


Port Type Description
Enable Any Enable listener
Disable Any Disables listener
WeaponId Any Weapon ID
WeaponClass String Weapon name
ShootCount Integer Number of times the listener can be triggered. 0 = infinite


Port Type Description
OnShoot Any Triggered when shooting
ShootsLeft Integer Triggered when shooting left
OnMelee Any Triggered on melee attack
OnDropped String Triggered when weapon is dropped