How to Lock rotation for few seconds only when every time the object rotates 180 degree?

Hi guys!
Actually, I have an AI for fishes swimmer around in an area. Everything is working fine here. However, after I created some bubbles and when they collided to some fishes, some of them start rotating itself forever. I researched and trying to solve it for a long time, but I really can’t fix it.

Everything is fine without the bubble, but I really need that bubble. So, I’m thinking maybe just let the bugged fish stop rotating for few second will solve the problem, but I really have no idea how to do that.

Without seeing your code i can’t say. You need to get the actual collider component on the game object. BoxCollider, or SphereCollider, etc…

Physics.IgnoreCollision(this.gameobject.GetComponent<Collider>(), collision.gameObject.GetComponent<Collider>());