simple AI script for enemy tanks

What algorithm should i use ?

What do you want them to do? Have you googled this at all? There’s plenty of basic AI tutorials out there.

When posting on the forums you have to be pretty specific to your issue. The question you posted is impossible to answer since we know nothing about your project. Is it a side-scrolling tank game? Is it a top-down tank game? Some other kind? Is it even actually 2D (this is the 2D forum)? What have you tried, what isnt working, etc.

Details are needed because there is almost never a one-solution-solves-all answer. Also, google first as jeffrey mentioned.

hi uh i have the same problem /idea its a top down tank game and i have created checkcolliders to check if i collided and then reverse etc.

and its 2d

Look up a Finite State Machine and use that for a basic AI script. You can use Raycasts to check for other colliders and then have actions when the rays detect something.