Trigger and Collider possible on same gameobject?

I have a ship in my game which I want to have a trigger for for many things, but I also want to keep the ship from going places it doesn’t belong. I’ve added a collider box to the mesh of the game object, but even though I disable collision though the matrix, they still seem to happen.
For example I have the ship flying a missiles shoot at it, the ship has a trigger detect which detects missiles and applies damage and adjusts health. However, when I add the collision box to the mesh, and disable it through the matrix with proper tags, when the missile hits I would assume the collision is ignored, however it causes the ship to spin as if it’s getting pushes and affected by gravity due to the collision.

This seems confusing and I’m there is a more simple way I’m failing to realize but any help would be appreciated.

Just add 2 new gameObjects and make your main object the parent of those. Attach a collider to each, set one to be a trigger. Bingo. They will work as if you attached them directly to the main gameObject since Unity will handle all colliders/triggers as compound colliders.

11 Likes

I know it was a long time, but thanks. Like, really. I fumbled 8 hours today, trying to get my Selector to ignore a detection trigger, while still colliding with the main body. OnMouseOvers, Raycast, everything felt futile.
And now, I found your solution. Thanks a lot!

We Rock!

3 Likes

Thank you so much i have been finding it for a long time ( sorry for the bad English)