Is this possible to detect collision with static colliders only I check it is not working. I dont want to use rigidbody or character controller with my box collider.


Static colliders shouldn't collide with one another, and they should not be used on objects that will move (such as a player). You may want to give more information about what it is that you are doing, but for most purposes, two static colliders will never hit. If one object is moving, it should have a rigidbody if physics are applied. Otherwise it should use a non-static collider.

Edit: thanks @philipp

  • 1
    \$\begingroup\$ "If one object is moving, it needs to have a rigidbody" - that's wrong. You only need a rigidbody when you want to move it with the physics engine. It is perfectly fine to have an object without a rigidbody and move it by manipulating its transform directly. But it is correct that the object should have a non-static collider in that case because static colliders are only fast as long as they don't move. It is possible to move them without causing any bugs, but you shouldn't because moving a static collider can be very performance-heavy. \$\endgroup\$ – Philipp Jun 14 '16 at 17:12
  • \$\begingroup\$ @Philipp Yes, thank you for the correction. Non-static (non-stationary) objects shouldn't use static colliders. And yes, non-rigidbody objects can collide but cannot have Unity physics applied. \$\endgroup\$ – Jesse Williams Jun 14 '16 at 17:19
  • 2
    \$\begingroup\$ @Philipp my understanding is that, in Unity, the collider is automatically treated as static if it doesn't have a rigidbody attached. The usual course of action I know of is to attach a rigidbody marked isKinematic = true so that you can manually drive its motion without interference from physics or the performance penalty of moving a static collider. \$\endgroup\$ – DMGregory Jun 14 '16 at 19:04
  • \$\begingroup\$ healthy info but what is there any way available to check collision with rigidbody \$\endgroup\$ – Muhammad Faizan Khan Jun 15 '16 at 5:13
  • \$\begingroup\$ @MohammadFaizanKhan - docs.unity3d.com/ScriptReference/… \$\endgroup\$ – Jesse Williams Jun 15 '16 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.