Search Unity

Riggid body not affected by Kinematic Object physicly

Discussion in 'Physics' started by pan-master, Mar 23, 2019.

  1. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    127
    I have a problem, I mean i have 2 objects
    1 Is Kinematic RigidBody, the second one is NormalRigidBody(dont use Gravity), When I colide Kinematic Rigid body into NormalRigidBody I presume NormalRigidBody Shoul Get Te velocity/direction/magnitue of movment of that Kinematic body during collision and move accordinly.(well It moves as if it was pushed without noticing velocities of collision)
    Do I have to script it, or there is an option to do just that? it looks like normal rigid body is sleeping during Kinematic object hitting normalriggidbody
     
    Last edited: Mar 23, 2019
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    You need to move the kinematic Rigidbody via Rigidbody.MovePosition and Rigidbody.MoveRotation from FixedUpdate. This way other non-kinematic objects will react properly to collisions with the kinematic one.

    Any other method of moving the kinematic object (i.e. Transform.position, Transform.rotation, Transform.Rotate, Rigidbody.velocity...) and/or moving it in Update instead of FixedUpdate will likely cause issues when colliding other bodies.
     
    felipepinho likes this.