I am trying to destroy an object when it collides with the trigger object, but it isn’t working.
I used the code:
using UnityEngine;
using System.Collections;
public class Collide : MonoBehaviour
{
void OnCollisionEnter (Collision col)
{
if(col.gameObject.name == “trigger”)
{ Destroy(col.gameObject); }
}
}
}
Any help would be appreciated, thank you.