Help with collision.

I have a non trigger collider and a line renderer with a trigger collider.
How do I check for collisions between the two and destroy my non trigger object on collision ?

OnTriggerEnter. At least one of the objects (preferably the moving one) must have a rigidbody.

The chart at the bottom of this page has the exact details of what collisions cause what messages to be sent.

OnTriggerEnter(collider col)
{
if (col.gameobject.tag=="trail")
gameobject.SetActive(false);
}

I tried this and attached it to the moving object. But nothing happened.

The collider with the trigger, and the gameobject script, has to have the collider set to “isTrigger”.

For me t

For me the trail is a child of the object. I cant seem to make it work in any way. Can someone help ?
It’s a 2D game.

Then you need to have 2D colliders, and name the method OnTriggerEnter2D.

void OnTriggerEnter2D(Collider2D col)
    {
      
        if (col.gameObject.tag=="Player"+playernumber) {
            Debug.Log ("Not Dead");  
        }
        else
        {
            Debug.Log("Dead");
        }

    }

worked but it always shows Dead.
the if statement doesn’t even work.