so im using an extremely simple script to rotate a motor forwards and backwards. and it works like charm for doing just that. however i would like it to only rotate when the button is held down, and free spin when nothing is pressed. as of right now you press up once and it rotates forever at the force thats set. here is the script im using at the moment. ive also tried using GetKeyDown and that didnt work either. i am very new to unity and scripting all together, any help is greatly appreciated
asked Oct 10 '10 at 11:18 PM
If you haven't already figured it out, I think this else statement should do the job.
You might also want to remove the .freespin = true; if you never set it to anything else
answered Nov 02 '10 at 04:32 AM
You need to add braces, otherwise the if statement will only conditionally affect the one line after it.
answered Oct 10 '10 at 11:26 PM