Hi everyone! I created a simple top-down 2D RPG and I have some simple enemies which I want to be wandering around using pathfinding. I added a NavigationAgent2D to the enemy scene and by defining a big NavigationRegion2D over the map enemies can walk to the destination ssuccessfully. However, they don't take tiles with collision shapes (for example rocks or other obstacles) into consideration. I've read that defining navigation data in tilemaps is very expensive, so what would be the workflow for such a use case? Should I really define a big region then go into every object on the map and create a small region to exclude it from the navigation area?
#2D Pathfinding with tilemaps in Godot 4
3 messages · Page 1 of 1 (latest)
Try to lookup obstacle avoidance. GDQuest has a video on it for the new Navigationserver in 3.5 (and should work pretty similarily in 4.0)
https://youtu.be/fS0IhyZrzts
Learn to Code from Zero, With Godot: https://gdquest.mavenseed.com/courses/learn-to-code-from-zero-with-godot
Godot Node Essentials (ultimate cookbook): https://gdquest.mavenseed.com/courses/godot-node-essentials
📚 THE LINKS
Godot 3.5 open-source demos: https://gdquest.github.io/godot-demos-2022/godot-35-new-features/
👥 CREDITS
Video...
I've looked into that, however if I'm understanding correctly that refers to avoiding moving objects with a NavigationObstacle2D node; I don't know how to apply that since I'm working with tilemap obstacles