Disclaimer: Am a noob. But from what I understand about collisions, both objects must have colliders and one must have a Rigidbody. I currently have a Rigidbody and Sphere collider on my player, and a collider on the obstacle game object.
Player:
Other Object:
And the Destroy script on my obstacle object is as follows:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Destroy : MonoBehaviour
{
void OnTriggerEnter(Collider col)
{
Destroy(col.gameObject);
}
}
My player is currently passing through the object and the collision is going undetected.
I should also mention that the obstacle object is a grand-child object, and both parents have neither rigid bodies nor colliders on them (I believe this is where I am running into trouble). Thank you very much for any help/advice anyone can give!