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.