Skip to content

BaseProjectileEffect ​

Inherits: CompositeEffect < Effect < DatabaseResource < Resource

Inherited by: BoomerangProjectileEffect, ChainProjectileEffect, DirectProjectileEffect, HomingProjectileEffect, PhysicsProjectileEffect

Base class for all projectile effects Handles shared functionality like spawn position, signals, and lifecycle

Properties ​

VFXSelectionLoopvfx_selection
floatprojectile_speed15.0
boolcharge_scales_speedfalse
Shape3Dprojectile_shape
Vector3offsetVector3(0.3, 1, -1)
VFXSelection.VfxLocationspawn_point

Methods ​

voidprocess_before_start( effect_instance: EffectInstance )
voidspecific_effect_logic( effect_instance: EffectInstance )
BaseProjectileInstanceget_projectile_instance( effect_instance: EffectInstance )
boolis_projectile_in_flight( effect_instance: EffectInstance )
Array[Entity]get_affected_entities( effect_instance: EffectInstance )
voidadd_affected_entity( effect_instance: EffectInstance, entity: Entity )
voidset_projectile_in_flight( effect_instance: EffectInstance, in_flight: bool )
voidon_apply_finished( effect_instance: EffectInstance )
Stringget_base_projectile_description()
Stringget_effect_description()
Stringget_editor_description()
boolis_one_off_application()
boolweapon_has_spawn_point( weapon_node: Node3D ) static
Vector3weapon_spawn_position( weapon_node: Node3D ) static

Enumerations ​

enum TriggerType ​

The options of trigger type: collision, destination, timer.

  • COLLISION = 0
  • DESTINATION = 1

Property descriptions ​

VFXSelectionLoop vfx_selection ​

VFX for the projectile visual

float projectile_speed = 15.0 ​

How fast the projectile travels, in units per second.

bool charge_scales_speed = false ​

A drawn shot flies faster the further it was drawn (a bow released early is slow)

Shape3D projectile_shape ​

Collision shape for projectile (defaults to small sphere if null)

Spawn Settings

Vector3 offset = Vector3(0.3, 1, -1) ​

Offset from spawn point (not used when the projectile leaves the weapon from its own spawn point)

VFXSelection.VfxLocation spawn_point ​

Spawn location. Weapon: the projectile spawn point set on the weapon mesh (Entity Assets > Equipment Meshes, the Spawn tool: a bow's string, a wand's tip), or the weapon with the offset when it has none

Method descriptions ​

void process_before_start( effect_instance: EffectInstance ) ​

Override duration setup to act as persistent effects

void specific_effect_logic( effect_instance: EffectInstance ) ​

Apply the projectile effect logic

BaseProjectileInstance get_projectile_instance( effect_instance: EffectInstance ) ​

Get projectile instance from effect

bool is_projectile_in_flight( effect_instance: EffectInstance ) ​

Check if projectile is in flight

Array[Entity] get_affected_entities( effect_instance: EffectInstance ) ​

Get affected entities

void add_affected_entity( effect_instance: EffectInstance, entity: Entity ) ​

Add affected entity

void set_projectile_in_flight( effect_instance: EffectInstance, in_flight: bool ) ​

Set projectile flight status

void on_apply_finished( effect_instance: EffectInstance ) ​

Handle effect finishing

String get_base_projectile_description() ​

Get base projectile description (subclasses can extend)

String get_effect_description() ​

Override this to provide complete effect description

String get_editor_description() ​

A short text for the effect editor that says what the effect does.

bool is_one_off_application() ​

What this effect does it does once, when it is applied: a loaded save does not do it again

bool weapon_has_spawn_point( weapon_node: Node3D ) ​

Does the weapon (a weapon slot node) have a projectile spawn point of its own (set on its mesh, it came over to the node in the hand)?

Vector3 weapon_spawn_position( weapon_node: Node3D ) ​

Where a projectile leaves the weapon: its spawn point, in the world