0 votes

I'm looking for a way to implement A* algorithm for 3D scene. It's easy to implement that for 2D but I can't think of a way to do that with 3D scene and all these objects that can block movement.
Anyone done that and can share some thoughts on how to achieve that?

in Engine by (378 points)

1 Answer

+1 vote
Best answer

A* already has a built-in implementation. It is used in 2D and 3D by both the Navigation2D and navigation nodes respectively. Unless you want to make a custom implement, these should suffice. Infact, there is a demo that demonstrates the navigation node at work. Any(follow up) questions?

by (3,857 points)

Thanks, didn't know that. About points, are they like nodes that A* is checking while looking for best path? If I want to go from A to B and there are rocks on the way, how do I handle that?

Points? What are you referring to? The array of points that the navigation node returns?

AStart add_point method.
Forget it, just checked example project from your answer (should have do that at the beginning) and it looks easier than I thought. Thanks.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.