Answers for "unity double press key"

C#
0

unity double press key

var ButtonCooler : float = 0.5 ; // Half a second before reset var ButtonCount : int = 0; function Update ( ) {    if ( Input.anyKeyDown ( ) ){        if ( ButtonCooler > 0 && ButtonCount == 1/*Number of Taps you want Minus One*/){          //Has double tapped       }else{         ButtonCooler = 0.5 ;          ButtonCount += 1 ;       }    }     if ( ButtonCooler > 0 )    {        ButtonCooler -= 1 * Time.deltaTime ;     }else{       ButtonCount = 0 ;    } }
Posted by: Guest on October-10-2021

C# Answers by Framework

Browse Popular Code Answers by Language