this problem sounds pretty easy to solve, but.... I don't get it.
I want to have a kind of loop that counts up the variable "acceleration" WHILE the space bar is pressed.And them when it is not pressed anymore I want to add a relative Force to the ball.
rigidbody.AddRelativeForce (Vector3.forward * acceleration);
So how do I write a counter, which counts while a button is pressed, and then, when it isn't anymore, it does whatever I want?
(For Example the Pinball game of windows)
It tried a while loop, which crashed my game several times...