OnCollisionEnter not appearing in Debug.Log [Solved]

I have a simple sphere collider that is a trigger and hitting the player’s box collider. Upon hitting I want the console to print “DIE” to let me know I’ve hit the sphere.

Here is the code

void OnTriggerEnter(Collider c) {
        if (c.tag == "Player") {
            Debug.Log("DIE");
        }
    }

I tagged the player prefab with the “Player” tag. There are no parse errors, and no other errors I can see. It just doesn’t say anything in the console log.

What could be possibly wrong with this code?

EDIT: I set “Is trigger” to both colliders.

Colliders don’t have tags, Do

I found out what was wrong. My original code works (b/c I’m guessing it checks if the boxcollider is connected to an object that has the tag “Player”).

I accidentally put the script and collider on the child object instead of the parent of what I was trying to collide. Did not know that mattered. Can someone explain why it does?

Hard to understand what you are asking. but if you are asking why it needs to be gameobject, then that’s because raycasts and such only react with colliders, not game objects themselves.

Basically I had game object called “Buzzsaw” and as a child there was “Saw” which had the UV texturing and all that good stuff.

I put the script on the child thinking it didn’t matter and it would collide but I guess since Buzzsaw was the actual physical object and inheritance only goes from top to bottom that it wasn’t technically a component of the object.