Hey guys I am new to unity and having a problem with a GUI.toggle. Basically all I want to do is check the value of the GUI.Toggle when I press a button. The problem im having is that the GUI.Toggle value is always false ? even when clicked ? Below is the code cheers to anyone who has insight into the problem
public class EditPersonalWorkoutScript : MonoBehaviour{
public bool checkValue;
void OnGUI()
{
checkValue = GUI.Toggle(new Rect(120, 260, 130, 20), checkValue,"");
}
void OnMouseUp(){
addTheExercises();
}
private void addTheExercises(){
print (checkValue);
}
}