Spaceship AI for 3d game

Basically I want to write AI for my 3d game player spaceship.
From 2d perspective you can thing like this, see attached image:

I require to save my Player ship against two kinds of enemies, ships and asteroids.
I want to write much simple and clear thing in implementation.

So please share your side idea regarding this, what kind of script I require to write?

It might be a bit overkill, but you might want to take a look at NavMesh which when used with a navmesh agent, will let it avoid obstacles, all you have to do is set a destination, and the navmesh agent will take care of the rest.

The reason I say this is a bit overkill is because this tool is designed for 3D navigation, which might make it use up more resources than other methods, although I believe this to be the simplest one.

Edit: I just saw the title mention the actual game is 3D and not 2D as shown on the image you made, so this should be perfect :smiley: