Skip to content

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 ​

Entityflee_from_entity
floatmax_flee_distance25.0
Vector3original_position

Methods ​

voidenter()
voidupdate( _delta: float )
voidexit()
voidset_state_data( data: Dictionary )
voidreturn_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