Collision without the use of Rigid Bodies

This is what I would like to do as I merely want to use the colliders as a means of signalling a collision (or more precisely an overlap of the bounds). So I just added the Collider2Ds to the objects and nothing happens.

Some reading around suggests that there has to be at least a rigid body attached - lo and behold it works but it starts spinning and pushing the objects. IsKinematic doesn’t seem to let it work (no events fired) so I set the constraints to tell it not to move but then this helpful hint pops up…
2564981--178721--colliderconstraint.png

Now that sounds like a great idea! Why won’t it work then?

Can I do this without the rigid body? I come from a native coding background and I’m trying to get my head around Unity’s way of thinking without getting angry… I’d rather not do my own thing but push come to shove…

Your player or whatever should look like this

The objects should look this

Both objects should have colliders

Making all the colliders into Trigger colliders would only signal, not interact. Don’t have to freeze all the positions and rotations.

1 Like

You dont even need a Rigidbody2D if you are not going to move it around, a Collider2D is perfectly fine without a Rigidbody if you dont move it on the game (if you do its quite expensive).
So add a Collider2D of your choice to the gameObject, set it to trigger and use OnTriggerEnter2D() in order to detect the collision.

http://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html

Yes, but as it said:

, so no it´s not needed in the static object.

1 Like