• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
16
Question by eyal · Jun 14, 2011 at 07:36 AM · rigidbodycollideriskinematic

RigidBody vs Collider

Hi All,

Can you please help me with this one?

What is the difference between having a game object with collider component and rigidbody component and the rigidbody component is kinematic vs a game object with collider only?

Afterall kinematic rigidbody doesn't obey the physics rules so what is the point of doing it? I saw some tutorials doing it for collision detection but for collision detection I can use collider without any rigidbody so why adding kinematic rigidbody?

Thank u in advance

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image biohazard · Jun 14, 2011 at 07:47 AM 0
Share

If i had to guess, i'd say that you need both a rigidbody (for physics stuff) and a collider (collision detection). otherwise your objects would hit each other and fly all over the place.

That's my guess, i haven't worked with Physics so far

avatar image eyal · Jun 14, 2011 at 08:05 AM 1
Share

But what is the meaning of game object with kinematic rigidbody and collider to one without rigifbody at all? after all kinematic rigidbody doesn't obet physics

5 Replies

· Add your reply
  • Sort: 
avatar image
21
Best Answer

Answer by Eric5h5 · Jun 16, 2011 at 05:03 PM

You can't have collision detection with only colliders and no rigidbodies. The point of kinematic rigidbodies is that you can move objects around directly (without physics), and still have collisions. Also, moving static colliders is bad, because the scene graph has to be recalculated, so generally objects that are being moved should be rigidbodies.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image nbg_yalta · May 25, 2014 at 03:02 PM 0
Share

With "moving static colliders is bad" do you mean objects with collider, marked as Static in inspector, or any objects without rigidbody?

avatar image MSpiteri nbg_yalta · May 31, 2016 at 11:25 PM 0
Share

He is referring to objects that are not static, no rigidbody, but have a collider. These objects are normally walls or floors. So they should not move anyway.

If you need to move something, for example, have a platform that moves vertically (like an elevator in old games), then you should set that platform to have both a collider (box collider in this case) and a rigidbody that is set to is$$anonymous$$inematic.

avatar image
50

Answer by Bampf · Jun 17, 2011 at 04:05 PM

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.)

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mirzero · Jul 10, 2012 at 04:54 AM 0
Share

I don't have the karma to give you a thumbs up yet, but I wanted to thank you! This answer is the clearest one here (to me), and totally solved my problems! So thanks!

avatar image Bampf · Jul 10, 2012 at 10:58 AM 0
Share

Thanks for letting me know! I like karma points, but I like knowing that I helped someone even better.

avatar image BlueMonkMN · Jun 23, 2013 at 01:02 PM 0
Share

I too lack the karma to give you a thumbs up, but your answer in particular made a lot of sense to me and clarified the collider versus rigidbody question well. I was confused why a few days ago I needed a collider and a rigidbody in order for my player to react to a house model imported from Sketchup, but this morning, I only need a collider (after re-importing). After reading your answer, I can conclude that a collider should be all I need, and I suspect some of the scaling or movement I did after importing it the first time confused the physics engine long enough for me to decide that I also needed a rigidbody that I shouldn't actually have on such a static object.

avatar image brett nieland · Sep 27, 2013 at 02:47 PM 0
Share

Thanks. I fourth the sentiments of @$$anonymous$$irzero, @Bampf, and @Blue$$anonymous$$onk$$anonymous$$N!

avatar image giantkilleroverunity3d · Mar 06, 2014 at 10:47 PM 0
Share

I saw this and think I could apply it.

Show more comments
avatar image
6

Answer by Owen-Reynolds · Jun 17, 2011 at 03:15 PM

The Kinematic setting solves certain occasional problems. In general, don't use it, but remember it's there. Two examples are turning on/off physics, and hinges:

You have a catapult with a child bullet in the scoop. Set kinematic to freeze it. When it is fired, unset Kin and give it a speed.

Say you want an animated object to ragdoll on death. For the ragdoll, you have to give all the bones rigidbodies. You start all bone RBs as Kinematic, to "turn off" physics, letting normal animation control everything. When it dies, you stop all animation and set all bone Kinematics back to false ("turn on" physics,) to let the ragdoll take over.

Hinges can only be linked to rigidbodies. Say you want a gate linked to a immobile post. You keep the post frozen but make it count as an RB by setting it kinematic.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image brett nieland · Sep 27, 2013 at 02:49 PM 0
Share

Great info! I wish I had the reputation to +1 this!

avatar image
1

Answer by Miladsob · Jul 20, 2020 at 09:05 PM

This tutorial from Learn department of Unity is very useful to understand Rigidbody, Collider, and difference between them

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by biohazard · Jun 16, 2011 at 10:06 AM

Think about special effects like rockets. since kinematic rigidbodies aren't affected by physics you could let them float up on Start.

a trail renderer, an explosion script and a trigger. You now have fireworks

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Jun 16, 2011 at 05:06 PM 0
Share

That's not a good example; rockets should be affected by physics. You would use AddForce to launch them and probably use a constant force component.

avatar image biohazard · Jun 17, 2011 at 06:18 AM 0
Share

how about you quit downvoting everyone whos not as perfect as you eric?

avatar image Eric5h5 · Jun 17, 2011 at 06:23 AM 6
Share

I downvote answers that are not helpful or incorrect. That's one of the points of this site and other sites like it (along with upvoting answers that are helpful, of course). I expect people to do the same with my answers. If you're going to take it personally, you should leave.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Activate physics when animation ends 0 Answers

How to get collision point when using onTriggerEnter 4 Answers

Moving kinematic rigidbody trigger against kinematic rigidbody collider 0 Answers

how to check for collison with a navmeshagent 0 Answers

Rigidbody bounce or character controller istrigger issues 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges