How to use Navigation2D on a Tilemap in Godot
Video Statistics and Information
Channel: NAD LABS
Views: 975
Rating: undefined out of 5
Keywords: Godot, Navigation, Tilemap
Id: To2CsTberho
Channel Id: undefined
Length: 18min 32sec (1112 seconds)
Published: Sat Apr 24 2021
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Thanks for making these tutorials!
I feel like this one is slightly confusing and needlessly over-complicating things though.
If you want to move the "thing-to-move" along a path, you can just make it the child of a PathFollow2D node and pass the path to follow to the PathFollow2D parent, a Path2D node.
Also, you don't need this long formula with those many abs(). This works exactly the same way and is much more readable, imho:
if position1.distance_to(position2) >= 5.0:
Just so people know, Navigation2D can only function from the origin of an object. It assumes that object is infinitely small, and thus collision will probably look off. If this is an issue, I recommend looking into A*