您的位置:首页 > 移动开发 > Unity3D

Unity3D - RigidBody vs Collider

2017-07-06 17:04 225 查看
转自RigidBody vs Collider

You can indeed have a collider with no rigidbody. If there's no rigidbody then Unity assumes the object is static, non-moving. Unity does not bother testing for collisions BETWEEN static objects. As you can imagine, this is very efficient if you have lots
of scenery the player can bump into.

So the purpose of having a kinematic rigidbody, rather than no rigidbody, is to turn on collision detection between this object and all other colliders in the scene (even the static ones.) Effectively you are letting Unity know that this object moves around,
so Unity will then do collision-detection between it and everything else.

(If you had a game with only two objects in it, and both move kinematically, in theory you would only need a rigidbody on one of them, even though they both move. I haven't tried it. But now imagine three such objects- you'd have to have rigidbodies on two
of them. So in practice you'll usually just put rigidbodies on everything that both moves and collides.)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: