OnTriggerEnter not working?

I have this script

However, the trigger is not working. I have marked the ‘is trigger’ box on the collider of my object and my limit. I’ve added a rigidbody to both as well. I’m working with 3d objects. I’ve also assigned the tags to the objects.
I added the debug.log but nothing seems to be happening.

just try

if (otro.gameObject.tag == “limX”))
{
Your Code.
}

I’m sure compare tag works, but the way you have it set up isn’t problem I don’t believe.
the way i showed you is correct.

The problem is you keep moving the object in the same direction inside Update function no matter where the object is.

Once the OnTriggerEnter function fires, the object will move towards (-dirX, -dirY, 0) for only one frame and then continue to move towards (dirX, dirY, 0) afterwards (because of the Update function), so it looks like it doesn’t work. Instead of calling transform.Translate inside OnTriggerEnter, just change dirX and dirY and let the Update function move the object.

if(outro.gameobject.tag=="limX || outro.gameobject.tag==“limy”){

}