Search Unity

the object passes through the collider

Discussion in 'Scripting' started by Trild123787898, Jan 18, 2020.

  1. Trild123787898

    Trild123787898

    Joined:
    Dec 9, 2018
    Posts:
    206
    how can I make sure that a rigidbody object does not pass through the collider when isKinematic is turned on ?
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    Ignoring forces and collisions is kind of the whole point of isKinematic.
    https://docs.unity3d.com/ScriptReference/Rigidbody-isKinematic.html
    It exists for cases where you need to have a Rigidbody but dont actually want it to be physically simulated.

    If you still want to collide with things you need to do that manually. If you only want the rigidbody to be unaffected by physics, but still detect collisions, you could turn off isKinematic and instead freeze its rotation and position on all axis. That should (?) have the same effect. It would probably generally help if you explained what your usecase is.