Simple Trigger not working

So I have a player and a ring to pass thru ( flying).

The collision code and all object naming etc works fine, because if I set ring to trigger=false., and use OnCollisionEnter, everything works fine in script, bell rings when player bumps into the ring, and the ring moves properly with physics from the impact. But I dont want player to bump into the ring, I want him to pass thru.

Box collider is in center of ring.

So now if I switch the ring’s collider to trigger = true, then test…
still works like a collider, player bumps ring, sound plays.

If I change script to use OnTriggerEnter instead of OnCollisionEnter,
nothing happens at all.

void OnTriggerEnter ( Collision myCol) {

        if ( myCol.gameObject.tag  ==  "Player" ) {

                mySound.Play ();
         }
}

To turn a collision into a trigger, is there something else I’m supposed to do aside from changing the script and flagging the collision box to “Is Trigger” = true?

I would be happy to get the sound playing when player passed thru ring at this point. That will result in the ring never colliding with player at all.

But in actuality, I need to use a second collider so if player bumps the ring mesh, the ring moves with physics.
Meshcollider /convex is acting like a box and wont let player thru, but that is a second issue I have to get around.

Any help would be appreciated.

Just a side note:
If I remove the ( Collision myCol ) and just use () the trigger works fine.

But I need to find out what hit the trigger using the Collision Data, I don’t see a comparable Trigger type that I can replace it with, and all examples I see use the same Collision type for their triggers…

OnTriggerEnter() takes an optional Collider parameter, not a Collision parameter (because there’s no collision data available). Very easy to overlook; I missed that myself until you posted your most recent finding.

Ah ha!
I have no idea what the difference is, but I will find out now that I have had some wizardry help, thanks for pointing!

Just for other greenies…here was the solution:

void OnTriggerEnter ( Collider myCol) {
        if ( myCol.gameObject.tag  ==  "Player" ) {
                mySound.Play ();
         }
}

I had a similar issue but because I’m creating a 2d game, solved it using OnTriggerEnter2D(Collider2D other). …duhh :-p

Yes the function signatures have to match or it won’t get called.