Autoplay Button on Keyboard

Hey everyone. Just finished the “Automated Play Testing” video, and personally I consider it a hassle to always go to the inspector to turn on/off the Autoplay. So I added a GetKeydown to the Update() of my paddle to turn the Autoplay on or off. It’s nothing complicated, but it’s still very helpful. Here’s the code:

 void Update () {
    		if(Input.GetKeyDown(KeyCode.A)){
    			autoPlay = !autoPlay;
    		}
    	}
4 Likes

no, i don’t think so about syntax >>> !autoPlay not build succesful
void Udate(){
Cheatcode();
}
void Cheatcode () {
if ( Input.GetMouseButtonDown(2)){
autoPlay = true ;
}