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 ​
EffectInstance | effect_instance | |
Variant | originator | |
Variant | target | |
ProjectileMovement | movement_strategy | |
ProjectileTrigger | trigger_strategy | |
CombatManager | combat_manager | |
bool | active | false |
float | creation_time | 0.0 |
float | max_lifetime | 10.0 |
float | projectile_speed | 15.0 |
bool | in_flight | false |
Shape3D | shape_resource | |
Array[VFX] | projectile_vfx_array | [] |
VFXSelectionLoop | vfx_selection | |
RemoteTransform3D | vfx_remote | |
Timer | lifetime_timer | |
Callable | pool_return_callback | |
bool | signals_connected | false |
Methods ​
void | initialize( p_combat_manager: CombatManager, new_effect_instance: EffectInstance, new_originator: Variant, new_target: Variant, new_vfx_selection: VFXSelectionLoop, speed: float = 15.0 ) |
void | set_collision_shape( shape: Shape3D ) |
void | activate_projectile() |
void | set_trigger_strategy( strategy: ProjectileTrigger ) |
void | set_movement_strategy( strategy: ProjectileMovement ) |
void | deactivate_projectile() |
void | reset_projectile() |
void | set_pool_return_callback( callback: Callable ) |
Vector3 | get_movement_direction() |
float | get_age() |
bool | is_projectile_valid() |
Dictionary | get_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