BoomerangMovement ​
Inherits: ProjectileMovement < RefCounted
Boomerang movement strategy - travels to target, then returns to originator Has two phases: outbound and return with optional curve intensity
Variables ​
BoomerangPhase | current_phase | BoomerangPhase.OUTBOUND |
Entity | originator | |
Vector3 | outbound_target_position | |
float | target_arrival_threshold | 1.0 |
float | originator_arrival_threshold | 0.5 |
bool | track_moving_target | true |
float | return_speed_multiplier | 1.2 |
float | curve_intensity | 0.3 |
Vector3 | curve_bias | Vector3.ZERO |
Methods ​
void | set_target_arrival_threshold( threshold: float ) |
void | set_originator_arrival_threshold( threshold: float ) |
void | set_track_moving_target( enabled: bool ) |
void | set_return_speed_multiplier( multiplier: float ) |
void | set_curve_intensity( intensity: float ) |
void | set_curve_bias( bias: Vector3 ) |
void | force_return_phase() |
bool | wants_to_continue() |
BoomerangPhase | get_current_phase() |
bool | is_outbound() |
bool | is_returning() |
float | get_distance_to_current_target() |
float | get_current_effective_speed() |
bool | is_originator_valid() |
float | get_distance_to_target() |
void | cleanup() |
Enumerations ​
enum BoomerangPhase ​
Current movement phase
- OUTBOUND =
0 - RETURNING =
1 - FINISHED =
2
Variable descriptions ​
BoomerangPhase current_phase = BoomerangPhase.OUTBOUND ​
Which way the projectile goes now: out or back.
Entity originator ​
Reference to originator for return journey
Vector3 outbound_target_position ​
Target position for outbound phase (captured at start)
float target_arrival_threshold = 1.0 ​
Distance thresholds
float originator_arrival_threshold = 0.5 ​
How close to the originator the projectile must be to count as back.
bool track_moving_target = true ​
Whether to track moving entities during outbound phase
float return_speed_multiplier = 1.2 ​
Return speed multiplier (can be different from outbound speed)
float curve_intensity = 0.3 ​
Curve intensity (0.0 = straight, 1.0 = pronounced curve)
Vector3 curve_bias = Vector3.ZERO ​
Curve direction bias for consistent arcing
Method descriptions ​
void set_target_arrival_threshold( threshold: float ) ​
Set target arrival threshold
void set_originator_arrival_threshold( threshold: float ) ​
Set originator arrival threshold
void set_track_moving_target( enabled: bool ) ​
Enable/disable target tracking during outbound phase
void set_return_speed_multiplier( multiplier: float ) ​
Set return speed multiplier
void set_curve_intensity( intensity: float ) ​
Set curve intensity
void set_curve_bias( bias: Vector3 ) ​
Set curve bias direction
void force_return_phase() ​
Force transition to return phase (useful for triggered returns)
bool wants_to_continue() ​
Check if boomerang movement wants to continue
BoomerangPhase get_current_phase() ​
Get current phase
bool is_outbound() ​
Check if in outbound phase
bool is_returning() ​
Check if returning
float get_distance_to_current_target() ​
Get distance to current target (target during outbound, originator during return)
float get_current_effective_speed() ​
Get current effective speed
bool is_originator_valid() ​
Check if originator is still valid
float get_distance_to_target() ​
Override distance calculation based on current phase
void cleanup() ​
Override cleanup to reset phase