Rigid body vs Collider "is Trigger"

So I’m having issues with the “is Trigger” function for my collider. I want to trigger a ParticleSystem upon collision with “player” and I have my script, however when I check the “is Trigger” the object doesn’t collide with anything at all and just falls into oblivion.

I tried using Rigid body and Collider with “is Trigger on” to see if the rigid body would give collision and the collider could use the trigger function but it still falls through everything…

Am I doing something wrong? Or do I need to re-install or something?

1 Answer

1

The is trigger check box determines if your game object is a trigger or if it uses physics.

If you tick the check box then it is just a trigger, it doesn’t use any physics. So technically speaking it will just “go through” other objects. However once something collides with it the trigger functions will be called.

The different functions that get called can be viewed here

For example

 //Destroy everything that enters the trigger
 function OnTriggerEnter (other : Collider) {
    Destroy(other.gameObject);
 }

If you tick the is Trigger that function will be called any time something enters it’s collider.

Ok, so how would I add physics and Trigger? would I parent the object to an empty with a collider?

Well you could do it that way but I don't see why it's necessary. There might be an application where you need both but I can't think of it. I'm assuming you just want to use the ontrigger methods. Luckily unity has made those same methods but for collision, which just means it's when using physics. For example this one does the same as above http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnCollisionEnter.html