HomingMovement ​
Inherits: ProjectileMovement < RefCounted
Inherited by: CurvedHomingMovement
Homing movement strategy - continuously tracks and follows target Updates direction each frame to chase moving targets
Variables ​
float | homing_strength | 1.0 |
float | max_turn_rate | PI * 2.0 # 360 degrees per second |
float | arrival_threshold | 1.0 |
bool | use_smooth_steering | true |
float | max_speed | 30.0 |
Vector3 | velocity | Vector3.ZERO |
Methods ​
void | set_homing_strength( strength: float ) |
void | set_max_turn_rate_degrees( degrees_per_second: float ) |
void | set_arrival_threshold( threshold: float ) |
void | set_smooth_steering( enabled: bool ) |
void | set_max_speed( new_max_speed: float ) |
Vector3 | get_current_velocity() |
float | get_current_actual_speed() |
float | get_angle_to_target() |
bool | is_facing_target( tolerance_degrees: float = 10.0 ) |
bool | wants_to_continue() |
void | cleanup() |
Variable descriptions ​
float homing_strength = 1.0 ​
How quickly the projectile can turn (0.0 to 1.0)
float max_turn_rate = PI * 2.0 # 360 degrees per second ​
Maximum turn rate per second (in radians)
float arrival_threshold = 1.0 ​
Distance threshold to consider target reached
bool use_smooth_steering = true ​
Whether to use smooth steering or instant direction changes
float max_speed = 30.0 ​
Maximum speed the projectile can reach
Vector3 velocity = Vector3.ZERO ​
Current velocity vector
Method descriptions ​
void set_homing_strength( strength: float ) ​
Set homing strength (0.0 = no homing, 1.0 = perfect homing)
void set_max_turn_rate_degrees( degrees_per_second: float ) ​
Set maximum turn rate in degrees per second
void set_arrival_threshold( threshold: float ) ​
Set arrival threshold
void set_smooth_steering( enabled: bool ) ​
Enable/disable smooth steering
void set_max_speed( new_max_speed: float ) ​
Set maximum speed
Vector3 get_current_velocity() ​
Get current velocity
float get_current_actual_speed() ​
Get current actual speed
float get_angle_to_target() ​
Get angle to target (in degrees)
bool is_facing_target( tolerance_degrees: float = 10.0 ) ​
Check if projectile is facing target (within tolerance)
bool wants_to_continue() ​
Homing movement doesn't need to continue after triggers
void cleanup() ​
Reset velocity on cleanup