I want it when your finger is on the button, i want the variable to be true, and when its not, i want it to be false. But GUI button is a click function so it just is a trigger not a boolean. What do i do to make it true if finger is there, and false if it is not. Idk if it will help but here is my OnGUI function
function OnGUI(){
GUI.Label(Rect(15, 15, 32, 32), planeCrash.rings.ToString(), Style);
if(GUI.Button(Rect(Screen.width*0.9, Screen.height*0.9, 100, 50), buttonRight, Style)){
yaw = 75;
animator.SetBool("yawRight", true);
rightButton = true;
}else{
animator.SetBool("yawRight", false);
rightButton = false;
}
if(GUI.Button(Rect(Screen.width*0.1, Screen.height*0.9, 100, 50), buttonLeft, Style)){
yaw = -75;
animator.SetBool("yawLeft", true);
leftButton = true;
}else{
animator.SetBool("yawLeft", false);
leftButton = false;
}
if(leftButton == false && rightButton == false){
yaw = 0;
animator.SetBool("yawLeft", false);
animator.SetBool("yawRight", false);
}
}