Search Unity

(5.5.0f3) Rigidbody2D still affected by Physics when IsKinematic is set.

Discussion in 'Physics' started by David-Flook, Jan 6, 2017.

  1. David-Flook

    David-Flook

    Joined:
    Nov 13, 2013
    Posts:
    48
    a) Set the velocity on a dynamic rigidbody2D to get it moving or simply let gravity make it fall.
    b) Switch the body type to Kinematic either through the inspector or script
    Result: rigidbody2D keeps moving.
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    That is the new behaviour of Kinematic. If you want the "old" behaviour turn off simulated.
     
    Deleted User likes this.
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,475
    It's actually a fix. Changing the body-type of a Rigidbody2D should do just that and only that and not also change its linear/angular velocity. Kinematic bodies can have their linear and angular velocity set and will move (unlike a 3D Rigidbody). A Kinematic body just doesn't reponds to physics forces (it effectively has zero mass similar to a Static body). A Static body ignores any linear or angular velocity set and forces applied.

    If you want the body to stop moving then reset the linear/angular velocity. If you want the body to stop responding to forces then set it to Kinematic. If you want the body to stop and not respond to forces or ever be moved by yourself then set it to Static. Turning off simulation is super fast but that's for when you want the body, its colliders, joints, effectors (etc) to temporarily ignore all physics in the simulation (note that it doesn't change any velocities or properties of any of those objects).
     
    Last edited: Feb 6, 2020