Weapon🔗

Inherits: Node3D

Inherited By: AutomaticWeapon, GrenadeLauncher, SpaceGun

This class defines a Weapon.

Propiedades🔗

int

ammo

int

max_ammo

int

ammo_usage

float

cooldown

1.0

Array [Node3D]

sockets

Skeleton3D

player_skeleton

Skeleton3D

weapon_skeleton

Timer

_cooldown_timer

Métodos🔗

void

set_ammo(new_ammo: int)

void

_ready()

void

trigger()

void

_on_primary(pressed: bool)


Signals🔗

triggered() 🔗

Emitted after trigger is called.


ammo_changed(new_ammo: int) 🔗

Emitted when ammo is changed (useful for HUD display).


Property Descriptions🔗

int ammo 🔗

  • void set_ammo(new_ammo: int)

The ammunition count.


int max_ammo 🔗

The maxmimum ammunition count.


int ammo_usage 🔗

The number of ammo used when triggered is emitted.


float cooldown = 1.0 🔗

The cooldown until this Weapon can be triggered again.


Array [Node3D] sockets 🔗

There is currently no description for this property. Please help us by contributing one!


Skeleton3D player_skeleton 🔗

There is currently no description for this property. Please help us by contributing one!


Skeleton3D weapon_skeleton 🔗

There is currently no description for this property. Please help us by contributing one!


Timer _cooldown_timer 🔗

The internal timer to handle trigger cooldown


Method Descriptions🔗

void set_ammo(new_ammo: int) 🔗

There is currently no description for this method. Please help us by contributing one!


void _ready() 🔗

There is currently no description for this method. Please help us by contributing one!


void trigger() 🔗

This methods triggers the Weapon.


void _on_primary(pressed: bool) 🔗

There is currently no description for this method. Please help us by contributing one!