Search Unity

How to determine an object has stopped rotating?

Discussion in 'Scripting' started by aerende, Oct 18, 2010.

  1. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    If an object rolls and stops rolling due to friction, does anyone know how to determine when the object has stopped rotating and is hence stationary?
     
    Last edited: Oct 18, 2010
  2. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Assuming you're working with rigidbodies, you can check rigidbody.angularVelocity. If its magnitude property is zero there is no rotational movement.
     
  3. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    @Tinus -

    Yes I am working with rigidbodies. Thank you so much!