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.

1 Answer

1

You could use a trigger and the function OnTriggerEnter to detect if a Collider enters the trigger.