NonPhysicalProjectileInstance ​
Inherits: BaseProjectileInstance < Node3D
Lightweight projectile with raycast-only collision detection Movement is handled entirely by movement strategies, this class only provides collision detection
Variables ​
Vector3 | velocity | Vector3.ZERO |
Vector3 | movement_direction | Vector3.FORWARD |
Vector3 | previous_position | |
float | raycast_range | 5.0 |
bool | use_raycast_collision | true |
Methods ​
void | activate_projectile() |
void | deactivate_projectile() |
void | set_velocity( new_velocity: Vector3 ) |
Vector3 | get_velocity() |
float | get_current_speed() |
void | stop_projectile() |
void | set_direction( new_direction: Vector3 ) |
void | accelerate( acceleration: Vector3, delta: float ) |
void | apply_steering_force( force: Vector3, max_force: float = 10.0 ) |
float | get_distance_to_target() |
bool | is_near_target( threshold: float ) |
Vector3 | get_direction_to_target() |
Vector3 | get_movement_direction() |
void | reset_projectile() |
Dictionary | get_projectile_debug_info() |
Variable descriptions ​
Vector3 velocity = Vector3.ZERO ​
Current movement velocity (set by movement strategies)
Vector3 movement_direction = Vector3.FORWARD ​
Current movement direction (normalized, set by movement strategies)
Vector3 previous_position ​
Previous position for raycast collision detection
float raycast_range = 5.0 ​
Raycast range per frame for collision detection
bool use_raycast_collision = true ​
Always use raycast collision (no Area3D)
Method descriptions ​
void activate_projectile() ​
Override activate to setup raycast collision
void deactivate_projectile() ​
Override deactivate - no special cleanup needed
void set_velocity( new_velocity: Vector3 ) ​
Set velocity (called by movement strategies)
Vector3 get_velocity() ​
Get current velocity
float get_current_speed() ​
Get current speed
void stop_projectile() ​
Stop the projectile movement
void set_direction( new_direction: Vector3 ) ​
Change direction while maintaining speed
void accelerate( acceleration: Vector3, delta: float ) ​
Apply acceleration (for movement strategies that need it)
void apply_steering_force( force: Vector3, max_force: float = 10.0 ) ​
Apply steering force (for homing projectiles)
float get_distance_to_target() ​
Get distance to target (useful for movement strategies)
bool is_near_target( threshold: float ) ​
Check if within distance of target
Vector3 get_direction_to_target() ​
Get direction to target
Vector3 get_movement_direction() ​
Override movement direction getter
void reset_projectile() ​
Override reset for raycast-specific cleanup
Dictionary get_projectile_debug_info() ​
Get debug info specific to non-physical projectiles