Files
godot-demo-projects/2d/navigation_astar
Simon Ruderich 89b2660d69 Migrate Navigation AStar demo to TileMapLayer and perform various cleanups (#1208)
* navigation_astar: replace deprecated TileMap with TileMapLayer

* navigation_astar: use get_used_cells() instead of iterating over region

This also removes the confusing use of Tile.OBSTACLE. The tile enum is
mostly used for atlas coordinates but in this case it is compared with
the source id which only happens to be zero as well.

* navigation_astar: use constants for atlas coordinates

This makes it more obvious how to set cells in larger tilesets where the
second position is not zero.

It also removes the constant OBSTACLE which is unused since the last
commit.

* navigation_astar: mention get_used_rect()

Using it in this example is more complex (as the border has no cells)
but it's good to know.
2025-06-30 18:09:02 +02:00
..
2025-03-21 02:00:41 +01:00
2025-03-21 02:00:41 +01:00

Grid-based Navigation with AStarGrid2D

This is an example of using AStarGrid2D for navigation in 2D, complete with Steering Behaviors in order to smooth the movement out.

Language: GDScript

Renderer: Compatibility

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2723

Screenshots

Screenshot