Check collision or triggering by accessing its component?

Is that possible to access the info of collision or triggering of the BoxCollider or other Collision/Trigger component without using messages like OnCollisionEnter2D() or OnTriggerEnter2D on C# Script?

For example, I have this code here:

[SerializeField] private BoxCollider2D frontCollider;

bool collision = false;

void Update()
{
  collision = frontCollider.isCollidingWithTag("Other");
}

Is that possible to get what collider the frontCollider is touching depending from its tag and supposing that the defined BoxCollider2D belongs to another gameObject?

Hello. No and Yes :smiley:

The only wat to detect colliders is by OnCollision/Ontrigger functions and by using Raycasts.

Bye.