ChasingState ​
Inherits: ActionState < Resource
ChasingState with LOS-aware navigation that repositions when stuck
Variables ​
float | attack_range | 1.0 |
Vector3 | last_target_position | Vector3.ZERO |
int | repositioning_attempts | 0 |
Methods ​
void | enter() |
void | exit() |
void | update( delta: float ) |
void | update_attack_range() |
bool | is_in_attack_range() |
bool | is_ready_to_attack() |
Constants ​
intMAX_REPOSITIONING_ATTEMPTS =3- How many times the entity moves to get a clear line to its target before it gives up.
Variable descriptions ​
float attack_range = 1.0 ​
Calculated attack range distance
Vector3 last_target_position = Vector3.ZERO ​
Track target position to avoid spam updates
int repositioning_attempts = 0 ​
Counter to prevent infinite repositioning attempts
Method descriptions ​
void enter() ​
Called when entering the chasing state
void exit() ​
Called when exiting the chasing state
void update( delta: float ) ​
Called every frame to update the chasing state
void update_attack_range() ​
Updates the attack range based on basic attack
bool is_in_attack_range() ​
Checks if the entity is within attack range of its target
bool is_ready_to_attack() ​
Checks if the entity can attack (in range AND has line of sight)