FleeState ​
Inherits: ActionState < Resource
FleeState represents when an entity is fleeing from another entity. The entity runs away from the originator of the flee effect.
Description ​
Key features:
- Runs away from specified entity
- Periodic direction updates to maintain distance
- Configurable max flee distance
- Automatically exits when flee effect expires (handled by EffectsComponent)
Variables ​
Entity | flee_from_entity | |
float | max_flee_distance | 25.0 |
Vector3 | original_position |
Methods ​
void | enter() |
void | update( _delta: float ) |
void | exit() |
void | set_state_data( data: Dictionary ) |
void | return_all_timer() |
Variable descriptions ​
Entity flee_from_entity ​
Entity to flee from
float max_flee_distance = 25.0 ​
Max distance to flee before stopping
Vector3 original_position ​
Original position when entering state
Method descriptions ​
void enter() ​
Called when entering the flee state
void update( _delta: float ) ​
Called every frame to check state and distance
void exit() ​
Called when exiting the flee state
void set_state_data( data: Dictionary ) ​
Set state data from external source
void return_all_timer() ​
Timer cleanup