CurvedHomingMovement ​
Inherits: HomingMovement < ProjectileMovement < RefCounted
Homing movement with curve patterns and rotation control Adds oscillation, spiraling, or wave patterns while still tracking target
Variables ​
HomingCurveType | curve_type | HomingCurveType.STRAIGHT |
float | curve_strength | 0.3 |
float | oscillation_frequency | 2.0 |
float | oscillation_amplitude | 1.0 |
float | curve_time | 0.0 |
CurveRotationMode | curve_rotation_mode | CurveRotationMode.UP |
float | fixed_curve_rotation | 0.0 |
float | random_rotation_range | 90.0 |
float | curve_rotation | 0.0 |
bool | use_left_curve | false |
Methods ​
void | set_curve_type( type: int ) |
void | set_curve_strength( strength: float ) |
void | set_oscillation_parameters( frequency: float, amplitude: float ) |
void | set_curve_rotation_mode( mode: CurveRotationMode ) |
void | set_fixed_curve_rotation( rotation_degrees: float ) |
void | set_random_rotation_range( range_degrees: float ) |
bool | wants_to_continue() |
void | cleanup() |
Enumerations ​
enum HomingCurveType ​
The options of homing curve type: straight, oscillating, spiral, sine wave, drunken.
- STRAIGHT =
0 - OSCILLATING =
1 - SPIRAL =
2 - SINE_WAVE =
3
enum CurveRotationMode ​
The options of curve rotation mode: fixed, left, right, up, down, alternating, random full, random range.
- FIXED =
0 - LEFT =
1 - RIGHT =
2 - UP =
3 - DOWN =
4 - ALTERNATING =
5 - RANDOM_FULL =
6
Variable descriptions ​
HomingCurveType curve_type = HomingCurveType.STRAIGHT ​
The shape of the curve added to the homing.
float curve_strength = 0.3 ​
How much curve affects movement (0.0 to 1.0)
float oscillation_frequency = 2.0 ​
Oscillation speed
float oscillation_amplitude = 1.0 ​
Oscillation strength
float curve_time = 0.0 ​
Time tracker for curve calculations
CurveRotationMode curve_rotation_mode = CurveRotationMode.UP ​
How the curve is rotated for each projectile.
float fixed_curve_rotation = 0.0 ​
Degrees from UP
float random_rotation_range = 90.0 ​
Degrees of random variation
float curve_rotation = 0.0 ​
Calculated rotation in radians
bool use_left_curve = false ​
Set externally for alternating mode
Method descriptions ​
void set_curve_type( type: int ) ​
Set curve type
void set_curve_strength( strength: float ) ​
Set curve strength (how much curve affects movement)
void set_oscillation_parameters( frequency: float, amplitude: float ) ​
Set oscillation parameters
void set_curve_rotation_mode( mode: CurveRotationMode ) ​
Set curve rotation mode
void set_fixed_curve_rotation( rotation_degrees: float ) ​
Set fixed curve rotation (in degrees)
void set_random_rotation_range( range_degrees: float ) ​
Set random rotation range (in degrees)
bool wants_to_continue() ​
Curved homing movement doesn't need to continue after triggers
void cleanup() ​
Resets the curve.