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
function FixedUpdate () {
if (Input.GetKey ("up"))
hingeJoint.motor.force = -10;
hingeJoint.motor.targetVelocity = -10;
hingeJoint.motor.freeSpin = true;
if (Input.GetKey ("down"))
hingeJoint.motor.force = 10;
hingeJoint.motor.targetVelocity = 10;
hingeJoint.motor.freeSpin = true;