Why cant triggerenter2d detect colliders

i got a ontriggerenter2d that would run code when it detects a specific colliderA. Everything works fine but the problem is that I have noticed that there are times when it would not detect the collider even if they are clearly colliding. It would only start detecting the colliderA again if the object with that collider moves or rotates. But there are times when it would detect consistently.

Edit: I have tirelessly checked my code, deducing where the problem originates but no avail. But I can consistently perform the bug. Ontriggerenter2d only detects colliderA once then ignores it until the object moves or rotates

Ontriggerenter2d only detects the one frame when the colliders collide. It doesn’t call again until the colliders separate and collide again. You might be looking for Ontriggerstay2d which keeps on calling every frame that the colliders stay together. Or Ontriggerexit2d which calls when the colliders separate.

Hello, I don’t know exactly where your problem is coming from, but from your last answer that you always check and uncheck the object, you could try Collider2D.GetContacts as well.

This function returns an array of colliders touching the collider whenever you call it, without having to disable anything.

public Collider2D[] visualizeResults;

public Collider2D contactTrigger;

private void Update()
{
    if (Input.GetKeyDown(KeyCode.Space))
    {
        visualizeResults = new Collider2D[5];

        contactTrigger.GetContacts(visualizeResults);
    }
}