Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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 ;-)