- Home /
Rotational Acceleration to a Maximum Speed
I've got an object that needs to rotate at a specific speed (rotations/second). Rather than jumping from stopped to full speed, I would like the rotation to ease into its max speed based on a "TimeToWarmUp" variable.
So I've got 3 variables: CurrentSpeed, MaxSpeed, and TimeToWarmUp. The first two are measured in rotations/second, the last is just in seconds.
Is there a function, or a mathematical formula that anyone knows of that I can use to move CurrentSpeed up to MaxSpeed in TimeToWarmUp seconds, while keeping the speed in rotations/second?
Thanks for the help!
Answer by Jason B · Mar 29, 2011 at 09:11 PM
Assuming we're working with euler angles, 360 * Time.deltaTime will mean 1 rotation per second (on whatever axis).
What you could do is something like Speed * Time.deltaTime.
And for instance, if you want one rotation a second, keep adding to Speed until it's at 360. At 360, it will be doing one rotation per second.
If rotations per second is easier to understand, just multiply how many rotations you want times 360. So if you want 100 rotations per second, 360 100 Time.deltaTime should do it.
Your answer
![](https://koobas.hobune.stream/wayback/20220613115619im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Frame Independent Movement with AddRelativeForce 1 Answer
Android Z Axis 0 Answers
Vector 3 and Acceleration Issue 0 Answers
Get absolute acceleration data from accelerometer/gyroscope but neglect rotational acceleration 1 Answer
Accelerator.x rotating camera.z - problems with intermediate values 0 Answers