i'm trying to make an object spin faster or sloewr by pressing a key on the keyboard but my code is not being executed

var propSlow : float = 10;
var propFast : float = 50;
var propSound : AudioClip;
var propspeed : boolean = false;

function Start () {

}

function Update () {

}

function spin(){

while(Input.GetKeyDown(KeyCode.Q) == true){

transform.Rotate(0,0,propFast);

}

while(Input.GetKeyUp(KeyCode.Q) == false){

transform.Rotate(0,0, propSlow);

}

}

First of all, Input.GetKeyDown(KeyCode.Q) == true and Input.GetKeyUp(KeyCode.Q) == false are the same thing. second of all your method “Spin()” is not being called from within this class, add spin(); to your Update() method to call that code.