UseLadderTask ​
Inherits: BehaviorTask < Resource
Climb a ladder (any entity can use) Enhanced with proper signal-based movement handling
Properties ​
int | ladder_id | 0 |
ClimbDirection | climb_direction | ClimbDirection.AUTO_DETECT |
bool | move_to_ladder | true |
float | interaction_distance | 3.0 |
float | climb_timeout | 30.0 |
bool | interrupt_if_occupied | false |
Variables ​
InteractableObject | target_ladder | null |
Timer | climb_timer | null |
bool | is_climbing | false |
bool | climb_started | false |
Vector3 | ladder_position | Vector3.ZERO |
float | interaction_range | 3.0 |
bool | movement_completed | false |
bool | ladder_interaction_completed | false |
Methods ​
void | execute_task_start() |
void | execute_task_complete() |
void | execute_task_interrupt() |
void | execute_task_fail() |
float | get_climb_progress() |
bool | is_ladder_accessible() |
float | get_distance_to_ladder() |
bool | is_in_ladder_interaction_range() |
void | set_ladder_id( new_id: int ) |
void | set_climb_direction( direction: int ) |
void | set_interaction_distance( distance: float ) |
void | cleanup_timers() |
Enumerations ​
enum ClimbDirection ​
The options of climb direction: auto detect, up, down.
- AUTO_DETECT =
0 - UP =
1 - DOWN =
2
Property descriptions ​
Target
int ladder_id = 0 ​
The unique ID of the ladder to climb
ClimbDirection climb_direction = ClimbDirection.AUTO_DETECT ​
Climb direction (0 = auto-detect, 1 = up, -1 = down)
bool move_to_ladder = true ​
Whether to move to ladder before climbing
float interaction_distance = 3.0 ​
Interaction distance from ladder
Behavior
float climb_timeout = 30.0 ​
Maximum time to wait for climb completion (seconds)
bool interrupt_if_occupied = false ​
Whether to interrupt if ladder becomes occupied (for single-climber ladders)
Variable descriptions ​
InteractableObject target_ladder = null ​
The ladder the entity climbs.
Timer climb_timer = null ​
The timer of the climb.
bool is_climbing = false ​
True while the entity climbs.
bool climb_started = false ​
True once the climb has started.
Vector3 ladder_position = Vector3.ZERO ​
The position of the ladder.
float interaction_range = 3.0 ​
How close the entity must be to use the ladder.
bool movement_completed = false ​
True once the entity arrived.
bool ladder_interaction_completed = false ​
True once the climb is done.
Method descriptions ​
void execute_task_start() ​
Starts the task.
void execute_task_complete() ​
Called when the task finishes well.
void execute_task_interrupt() ​
Called when something interrupts the task.
void execute_task_fail() ​
Called when the task fails.
float get_climb_progress() ​
How far along the ladder the entity is (0 to 1).
bool is_ladder_accessible() ​
Can the ladder be used now (it is not broken)?
float get_distance_to_ladder() ​
The distance to the ladder (-1 when there is none).
bool is_in_ladder_interaction_range() ​
Is the entity close enough to use the ladder?
void set_ladder_id( new_id: int ) ​
Set the target ladder ID dynamically
void set_climb_direction( direction: int ) ​
Set the climb direction dynamically
void set_interaction_distance( distance: float ) ​
Set interaction distance dynamically
void cleanup_timers() ​
Frees the timers of the task.