Skip to content

BaseProjectileInstance ​

Inherits: Node3D

Inherited by: NonPhysicalProjectileInstance, PhysicalProjectileInstance

Base class for all projectile instances - handles VFX, signals, and basic lifecycle Follows the same pattern as Effect/EffectInstance with shared functionality

Variables ​

EffectInstanceeffect_instance
Variantoriginator
Varianttarget
ProjectileMovementmovement_strategy
ProjectileTriggertrigger_strategy
CombatManagercombat_manager
boolactivefalse
floatcreation_time0.0
floatmax_lifetime10.0
floatprojectile_speed15.0
boolin_flightfalse
Shape3Dshape_resource
Array[VFX]projectile_vfx_array[]
VFXSelectionLoopvfx_selection
RemoteTransform3Dvfx_remote
Timerlifetime_timer
Callablepool_return_callback
boolsignals_connectedfalse

Methods ​

voidinitialize( p_combat_manager: CombatManager, new_effect_instance: EffectInstance, new_originator: Variant, new_target: Variant, new_vfx_selection: VFXSelectionLoop, speed: float = 15.0 )
voidset_collision_shape( shape: Shape3D )
voidactivate_projectile()
voidset_trigger_strategy( strategy: ProjectileTrigger )
voidset_movement_strategy( strategy: ProjectileMovement )
voiddeactivate_projectile()
voidreset_projectile()
voidset_pool_return_callback( callback: Callable )
Vector3get_movement_direction()
floatget_age()
boolis_projectile_valid()
Dictionaryget_projectile_info()

Signals ​

reached_destination() ​

Emitted when projectile reaches its destination

lifetime_expired() ​

Emitted when projectile lifetime expires

Variable descriptions ​

EffectInstance effect_instance ​

Reference to the effect instance that created this projectile

Variant originator ​

Reference to the originator entity

Variant target ​

The target (Entity or Vector3)

ProjectileMovement movement_strategy ​

Movement strategy component

ProjectileTrigger trigger_strategy ​

Trigger strategy component

CombatManager combat_manager ​

Combat manager refrence

bool active = false ​

Whether the projectile is currently active

float creation_time = 0.0 ​

When the projectile was created

float max_lifetime = 10.0 ​

Maximum lifetime before auto-destruction

float projectile_speed = 15.0 ​

Current speed of the projectile

bool in_flight = false ​

Whether projectile is in flight (prevents premature cleanup)

Shape3D shape_resource ​

Shape resource configured by the effect

Array[VFX] projectile_vfx_array = [] ​

The VFX instances attached to this projectile

VFXSelectionLoop vfx_selection ​

VFX selection used for this projectile

RemoteTransform3D vfx_remote ​

VFX remote

Timer lifetime_timer ​

Timer for projectile lifetime

Callable pool_return_callback ​

Pool return callback for VFXManager

bool signals_connected = false ​

Whether signals are currently connected

Method descriptions ​

void initialize( p_combat_manager: CombatManager, new_effect_instance: EffectInstance, new_originator: Variant, new_target: Variant, new_vfx_selection: VFXSelectionLoop, speed: float = 15.0 ) ​

Initialize the projectile with core data

void set_collision_shape( shape: Shape3D ) ​

Set collision shape (called by BaseProjectileEffect)

void activate_projectile() ​

Activate the projectile and begin movement

void set_trigger_strategy( strategy: ProjectileTrigger ) ​

Set trigger strategy

void set_movement_strategy( strategy: ProjectileMovement ) ​

Set movement strategy

void deactivate_projectile() ​

Deactivate the projectile

void reset_projectile() ​

Reset for pooling (mirrors EffectInstance.reset)

void set_pool_return_callback( callback: Callable ) ​

Set pool return callback (used by ProjectileManager)

Vector3 get_movement_direction() ​

Get current movement direction

float get_age() ​

Get time since creation

bool is_projectile_valid() ​

Check if projectile is valid and active

Dictionary get_projectile_info() ​

Get projectile info for debugging