Search Unity

object rotation

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

  1. Trild123787898

    Trild123787898

    Joined:
    Dec 9, 2018
    Posts:
    206
    how can I rotate an object that has a Configurable joint component
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Generally you use the
    RigidBody.MoveRotation()
    call when rotating objects that have physics associated with them. This gives the physics system a chance to respond.
     
  3. Trild123787898

    Trild123787898

    Joined:
    Dec 9, 2018
    Posts:
    206
    Yes, but it just staggers, but I need it to say that it would rotate the project by 30 degrees and become
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    You can use a coroutine or Update() to move it gradually over several frames. There's lots of coroutine tutorials out there in Youtube land. Coroutines are the basic way you cause "stuff to happen over time" in Unity.
     
  5. Trild123787898

    Trild123787898

    Joined:
    Dec 9, 2018
    Posts:
    206
    thanks for the answer, but I already found a good way for myself