- Home /
Question by
DeveLOLper · Mar 24, 2013 at 06:07 PM ·
stopacceleration
Stopping a bit of script once it reaches certain number.
So I made this script for acceleration:
var speed: 0.3
if(GetDownKey(KeyCode.UpArrow))
{
transform.Translate (speed += 2.0 * Time.deltaTime))
}
Basically I want the transform.Translate bit to stop once the speed reaches 153.6. How do I do this?
Comment
Your answer
Follow this Question
Related Questions
In game pause menu 2 Answers
how to stop animation loop? 1 Answer
Exit playmode at runtime using code 1 Answer
How can I completely stop a script? 1 Answer
Stop momentum of a ball 1 Answer