NavigationAgent2D¶
A 2D agent used to pathfind to a position while avoiding obstacles.
Description¶
A 2D agent used to pathfind to a position while avoiding static and dynamic obstacles. The calculation can be used by the parent node to dynamically move it along the path. Requires navigation data to work correctly.
Dynamic obstacles are avoided using RVO collision avoidance. Avoidance is computed before physics, so the pathfinding information can be used safely in the physics step.
Note: After setting the target_position property, the get_next_path_position method must be used once every physics frame to update the internal path logic of the navigation agent. The vector position it returns should be used as the next movement position for the agent's parent node.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
BitField<PathMetadataFlags> |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
distance_to_target ( ) const |
|
get_avoidance_layer_value ( int layer_number ) const |
|
get_avoidance_mask_value ( int mask_number ) const |
|
get_current_navigation_path ( ) const |
|
get_current_navigation_path_index ( ) const |
|
get_current_navigation_result ( ) const |
|
get_navigation_layer_value ( int layer_number ) |