Well, I have an airplane like a f16, however I’d like to rotate it right and left. The problem is that it stops rotating while I don’t press any key, so, if my airplane is rotating, i’d like it to continue rotating a little bit also after i have just took up my finger
You could always set up a variable for the speed at which the plane is turning around.
Lets say you press the right key to turn to the right. As you hold down the key, the variable would gradualy increase, and so would the speed at which the plane turns. And when not pressing any keys to turn, it would gradualy decrease the value of the variable to 0, and the plane would have the desired effect.
Example:
var turnSpeed;
function Update(){
if(rightKey){
turnSpeed ++;
} else {
turnSpeed--;
}
this.transform.rotation.y += turnSpeed;
}
All you would to do is set up a few variables for maximum turning speed, as well as to type some code to make it work with both keys instead of just one. Hope this helps!