I’m creating a space simulator in which the player combats with enemy ships in a field of procedural generated asteroids and obstacles. What is the best way I can get an enemy ship to pathfind it’s way to the player whilst avoiding the asteroids. Since the pathfinding needs to work in 3 dimensions, I doubt a navmesh will work since that only deals with surfaces. How can I program the AI to find a route to the player?
You could use the A* pathfinding algorithm, if you’re new to A* I recommend watching Sebastian Lague’s A* implementation tutorial series on YouTube - A* Pathfinding (E01: algorithm explanation) - YouTube