NetworkWeaponHitscan3D

Inherits: Node3D

A 3D-specific implementation of a networked hitscan (raycast) weapon.

Properties

Type Name Default
float max_distance 1000.0
int collision_mask 4294967295
RID[] exclude []

Methods

Return Type Name
bool fire()
bool can_fire()
bool _can_fire()
bool _can_peer_use(int peer_id)
void _after_fire()

Property Descriptions

float max_distance = 1000.0

Maximum distance to cast the ray


int collision_mask = 4294967295

Mask used to detect raycast hits


RID[] exclude = []

Colliders excluded from raycast hits


Method Descriptions

bool fire ( )

Try to fire the weapon and return the projectile.

Returns true if the weapon was fired.


bool can_fire ( )

Check whether this weapon can be fired.


bool _can_fire ( )

Override this method with your own can fire logic.

See NetworkWeapon.


bool _can_peer_use ( int peer_id )

Override this method to check if a given peer can use this weapon.

See NetworkWeapon.


void _after_fire ( )

Override this method to run any logic needed after successfully firing the weapon.

See NetworkWeapon.