Skip to content

DisorientedState ​

Inherits: ActionState < Resource

DisorientedState represents when an entity is disoriented. The entity wanders randomly within a radius of their original position.

Description ​

Key features:

  • Random wandering within configurable radius
  • Periodic direction changes
  • Tracks originating entity
  • Automatically exits when disorient effect expires (handled by EffectsComponent)

Variables ​

floatwander_radius5.0
Timerdirection_change_timer
Vector3original_position
Vector3random_target_position
Entitydisorienting_entity

Methods ​

voidenter()
voidupdate( _delta: float )
voidexit()
voidset_state_data( data: Dictionary )
voidreturn_all_timer()

Variable descriptions ​

float wander_radius = 5.0 ​

Wander radius

Timer direction_change_timer ​

Timer for changing direction

Vector3 original_position ​

Original position when entering state

Vector3 random_target_position ​

Current random target position

Entity disorienting_entity ​

Entity that caused the disorientation

Method descriptions ​

void enter() ​

Called when entering the disoriented state

void update( _delta: float ) ​

Called every frame to check state and update wandering

void exit() ​

Called when exiting the disoriented state

void set_state_data( data: Dictionary ) ​

Set state data from external source

void return_all_timer() ​

Timer cleanup