- Home /
How I can make gameobject detect collisions and make every other gameobject be able to go through it?
I'm trying to make hidespot(invisible box object) to my character, but it doesn't detect collisions if either my character or hidespot have rigidbody. Character doesn't need to have rigidbody so I made rigidbody to my hidespot. It works fine, but when enemies with rigidbodies tries to go through the hidespot they crashes to it and often got stuck. I would like my hidespot be able to detect collisions but also allow objects go through it.
Answer by efge · Apr 09, 2011 at 08:28 PM
You could use a trigger and the function OnTriggerEnter to detect if a Collider enters the trigger.
I used triggers ins$$anonymous$$d of collisions and also added kinematic rigidbody to my character since triggers require atleast one rigidbody to work. Note: if you add rigidbody to object that stands still it will go "sleep" and doesn't detect colliders without rigidbodies.