0 votes

Hello, how can I make an opponent follow my player and avoid objects like walls, trees, fences ...? But all of this without a * pathfinding or navigation? How does it work?

Godot version 3.2.3
in Engine by (86 points)

1 Answer

0 votes

If your enemy knows where the player is, it can move towards it. As for avoiding obstacles, you can use a few Raycasts to steer away from them. However, the enemy will get stuck on corners, which is why A* or other methods exist. If you want to implement your own pathfinding, you could make D*.

by (2,484 points)

Hey, thank you for your answer, can you linked me a video or write a script?

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.