How would I do this??

I have been working on collision detection but because my objects are fish moving in all different directions and orientations with different speeds CD can be a problem. Example If i have a fish near a rock and i have it turn left that works, but if the rock is on the fish’s left side it turns into the rock

What i am trying to figure out is how to make my object turn in the opposite direction so if the rock is on the left of the fish it will ONLY turn right and if the rock is on the right of the fish it will ONLY turn left. Not sure how to do it. be detailed if have an idea Thankx

digiman

I will make 2 sensor at the side-by-side on the fish head. Turning to another direction if its near collision. Avoiding obstacles and each other.

An idea for a setup like the above video would be to have two empties which are parented to the front of the fish. This act as sort of “whiskers”.
Then using python, detect whether these whiskers have a collision, and depending on the whisker which is triggering true, rotate in a certain direction.