void OnTriggerEnter(Collider other)
{
Debug.Log("Collision detected with " + other.name);
}
The other object also has a collider and a rigidbody2d
void OnTriggerEnter(Collider other)
{
Debug.Log("Collision detected with " + other.name);
}
The other object also has a collider and a rigidbody2d
You’re using the 3D physics callbacks, not the 2D ones.
I recommend you follow some starter tutorials first as they show you the correct callbacks to use etc.
Use OnTriggerEnter2D instead of OnTriggerEnter
private void OnTriggerEnter2D(Collider2D other) {}