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...
Simple, adds to the power variable when the Jump button is down. When it is released we add force to the rigidbody.
Let me know if there are any errors :)
answered Apr 28 '11 at 06:29 PM
no errors, worked well :) , thx a lot
answered Apr 29 '11 at 10:43 PM