MoveToPointTask ​
Inherits: BehaviorTask < Resource
Complete MoveToPointTask with all Phase 1-3 enhancements. Features robust navigation integration, enhanced path failure handling, auto-updating progress, and comprehensive error recovery.
Properties ​
Vector3 | target_position | Vector3.ZERO |
float | min_distance | -1.0 |
bool | force_walking | true |
float | position_threshold | 0.1 |
int | max_pathfinding_attempts | 3 |
float | wait_time | 0.0 |
bool | face_direction_on_arrival | false |
Vector3 | arrival_face_direction | Vector3.ZERO |
MovementStyle | movement_style | MovementStyle.NORMAL |
bool | fail_on_path_failure | false |
bool | try_alternative_positions | true |
float | alternative_search_radius | 3.0 |
Variables ​
int | current_pathfinding_attempt | 0 |
Timer | wait_timer | null |
Vector3 | original_target_position | Vector3.ZERO |
bool | waiting_at_destination | false |
Methods ​
void | execute_task_start() |
void | execute_task_complete() |
void | execute_task_interrupt() |
void | execute_task_fail() |
void | set_target_position( new_position: Vector3 ) |
float | get_distance_to_target() |
bool | is_movement_complete() |
void | set_simplified_mode( enable: bool ) |
void | cleanup_timers() |
Enumerations ​
enum MovementStyle ​
The options of movement style: normal, keep facing, backpedal.
- NORMAL =
0- Regular movement with turning - KEEP_FACING =
1- Move without changing facing direction - BACKPEDAL =
2- Move backwards while keeping current facing
Property descriptions ​
Movement
Vector3 target_position = Vector3.ZERO ​
Target position to move to
float min_distance = -1.0 ​
Minimum distance to maintain from target (-1 = use navigation default)
bool force_walking = true ​
Whether to walk instead of run
float position_threshold = 0.1 ​
Position threshold for considering destination reached
int max_pathfinding_attempts = 3 ​
Maximum attempts to find a path before giving up
Destination Behavior
float wait_time = 0.0 ​
Time to wait at destination before completing (0 = complete immediately)
bool face_direction_on_arrival = false ​
Whether to face a specific direction after reaching destination
Vector3 arrival_face_direction = Vector3.ZERO ​
Direction to face after arrival (if face_direction_on_arrival is true)
Movement Type
MovementStyle movement_style = MovementStyle.NORMAL ​
Type of movement to use
Error Handling
bool fail_on_path_failure = false ​
Whether to fail task if path cannot be found
bool try_alternative_positions = true ​
Whether to try alternative nearby positions if exact position fails
float alternative_search_radius = 3.0 ​
Distance to search for alternative positions
Variable descriptions ​
int current_pathfinding_attempt = 0 ​
Current pathfinding attempt
Timer wait_timer = null ​
Timer for waiting at destination
Vector3 original_target_position = Vector3.ZERO ​
Original target position (before any adjustments)
bool waiting_at_destination = false ​
Whether we're currently waiting at the destination
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.
void set_target_position( new_position: Vector3 ) ​
Sets the point the entity moves to.
float get_distance_to_target() ​
The distance to the point (-1 when there is no entity).
bool is_movement_complete() ​
Did the entity arrive (and wait there, if the task waits)?
void set_simplified_mode( enable: bool ) ​
Check if we can modify this task for simplified behavior (LOD system support)
void cleanup_timers() ​
Frees the timers of the task.