Search Unity

Moving rigidbody with physics

Discussion in 'Physics' started by h0nka, Jun 13, 2020.

  1. h0nka

    h0nka

    Joined:
    Apr 7, 2013
    Posts:
    109
    Hello

    So I have been using rigidbodies for a while and I know that moving a GameObject via its transform eliminates rigidbody collision, but what about setting the rigidbody rotation directly, and what about MoveRotation / MovePosition of none kinematic rigidbodies? I guess I would really like to know once and for all, which of the following methods of translation and rotation will respect rigidbody collision physics:

    - Rigidbody.MovePosition / Rigidbody.MoveRotation
    - Rigidbody.rotation / Rigidbody.position
    - Transform.rotation / Transform.position
    - Rigidbody.Addforce / Rigidbody.AddTorque
    - Other methods(?)

    Thanks!
     
  2. Modafuka

    Modafuka

    Joined:
    Nov 21, 2019
    Posts:
    45
    Rigidbody.Something methods in FixedUpdate() loop will respect to collision.
     
  3. h0nka

    h0nka

    Joined:
    Apr 7, 2013
    Posts:
    109
    Makes sense! Thanks mofo ;-)