Search Unity

What are Kinematic Rigidbodies for?

Discussion in 'Physics' started by RakNet, Dec 27, 2018.

Thread Status:
Not open for further replies.
  1. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    I created a scene with a Collider and a Collider with a kinematic Rigidbody on the same game object. In both cases they acted the same and triggered the same collision events. What is the difference between having a kinematic rigidbody and not having that component at all?

    upload_2018-12-26_23-6-16.png
     
    SAMYTHEBIGJUICY and honor0102 like this.
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    honor0102 likes this.
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    It's useful for making object completely controlled by the script and resolving collisions via scripts without using forces.
    Kinematic rigidbodies also receive collision callbacks, so that they can be used as well.

    Not to mention that you can always switch between script controlled entities, and physics controlled ones simply by changing one flag. E.g. That can be used for the ragdoll on certain events, like enemies falling dead, or throwing objects etc.
     
  4. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    The reaspn you need a kinametic rigidbody instead of just having the object with a collider is for the physics system.

    If you dont have a kinametic rigidbody the system needs to destroy the collider and rebuild it when ever you move it.(or so i understand it, im not an expert on unity and physix)

    If you dont plan on moving it dont add a rigudbody at all and mark it as static.

    EDIT: So I was lying to you, check out edy's comment below.
     
    Last edited: Dec 27, 2018
  5. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,506
    This is incorrect and it's a common misunderstanding. Since Unity 5 you can move static colliders (no rigidbodies) without incurring in a penalty. However, the official documentation is not yet updated on this, so it causes confusion.

    A kinematic rigidbody is like a regular rigidbody but the pose controlled by scripting (via Rigidbody.MovePosition and Rigidbody.MoveRotation from FixedUpdate), instead of by the physics. Having a rigidbody instead of the collider alone is helpful as the interpolation options will be applied and you may still read its velocity and angular velocity.

    Here's a quick guide on the applications of the different rigidbody / kinematic / collider combinations:
    https://forum.unity.com/threads/hel...r-rigidbody-combinations.525258/#post-3452001
     
    Last edited: Dec 29, 2018
    xVergilx, SparrowGS and hippocoder like this.
  6. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    to temporary shutdown for a rigidbody?
     
  7. DemonDev10

    DemonDev10

    Joined:
    Jan 11, 2019
    Posts:
    8
    In simple terms Kinematic rigidbody means:

    1. Unity will not apply any physics to the kinematic Rigidbody.

    2. If rigidbody is kinematic, you can handle the behavior of rigidbody yourself using a script and unity will not apply any physics to that object.

    3. So for example, if you have a kinematic rigidbody floating in the air and you hit on the play button. That object will still be floating and will not fall to the ground because Unity is not applying any forces to it. However, you can use your own logic and scripts to move that rigidbody independent of the unity physics system.

    4. Also, collision callbacks are detected by kinematic rigidbodies so if you are using OnColliderEnter etc. it will work.
    You can check out this video for more information as it is explained very clearly in this video about Is Kinematic rigidbodies along with some real world game examples :

     
    Last edited: Mar 4, 2021
    a01424567 and MelvMay like this.
  8. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,419
    Thanks for taking the time to add information here but also note the age of posts; this one is several years old.
     
    SparrowGS and hippocoder like this.
  9. DemonDev10

    DemonDev10

    Joined:
    Jan 11, 2019
    Posts:
    8
    Hi, Sorry, I didn't realize it is such an old post :oops:. Just wanted to ask Is there a way to make posts so that links to Youtube does not show up as a video in the posts but just a normal link which can be clicked ?
     
    hippocoder likes this.
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's cool don't worry! I locked this thread now.
     
Thread Status:
Not open for further replies.