Question by 
               Neo_kim · Jun 23, 2016 at 02:53 PM · 
                rotationtransform.rotationtransform.rotaterotatetowardsquaternion.slerp  
              
 
              Object rotate and slowly stop to toward
Hello. I want to rotate object by z axis.
Here is my code.
 [SerializeField] GameObject obj = default(GameObject);
 float _lotationSpeed = 50f;
 float _stopAngleZ = default(float);
 // determine stop angle z (range: 0 ~ 360)
 void StopRotate()
 {
     _stopAngleZ = 270f; // for example..
     _status = GameStatus.Stopping;        
 }
 void Update() 
 {
     switch(_status) 
     {
       case GameStatus.Rotate:
         obj.transform.Rotate(Vector3.back * _lotationSpeed);
         break;
       case GameStatus.Stopping:
         // TO-DO: rotate speed deceleration
         // TO-DO: change status Stopping -> Stopped
         break;
       case GameStatus.Stopped:
         // game end..
         break;          
     }
 }
 
               I already search same name. But I can't find a solution.
How can I slowly stop to toward?
(! important, I don't want to reverse rotation, keep a same direction)
               Comment
              
 
               
              Answer by Aggerwal · Jun 23, 2016 at 03:06 PM
You should look into Time.DeltaTime and multiply that in the obj.transform.Rotate like this: obj.transform.Rotate(Vector3.back Time.DeltaTime _lotationSpeed);
Your code is just rotation speed deceleration. When I called the StopRotate() then I can get a stop angle. but current angle is dynamically and need to stop condition
Your answer