Search code examples
collision-detectionunity-game-engine

Unity 3D collision detection for object totally within another object


I'm working on a game project right now, and I'm confused by the collision detection system in unity.

It seems that when a object is totally within another object, say a small capsule is within a large box, no collision information would be generated by the engine.

Is there any way to detect collision of this kind?

Also, what is the difference between using isTrigger and isKinematic? They seems to me to be doing the same thing, so I think I need more explanation on the difference.(except for the difference in function calls: OnTriggerEnter and OnCollisionEnter)

Thanks in advance!


Solution

  • I got it. For this kind of collision, instead of using OnTriggerEnter or OnCollisionEnter, we should use OnTriggerStay or OnCollisionStay