Hi Unity Community,
This is a question with a simple solution I hope. I have a GUI Toggle as show below and I am trying to use the function like so:
public bool pressed = false;
//bool Toggle(Rect position, bool value, string text, GUIStyle style); //the template im using
pressed = GUILayout.Toggle(new Rect(10, 50, 50, 50), pressed, "Back*", "Button");
I am trying to make my toggle act as a button and position it, which is probably my problem… The toggle acting as a button works fine if I do not include the Rect(x,x,x,x) argument. Anyways Unity keeps giving me this error
“Assets/Scripts/SquadSelect.cs(151,37): error CS1502: The best overloaded method match for `UnityEngine.GUILayout.Toggle(bool, UnityEngine.Texture, params UnityEngine.GUILayoutOption)’ has some invalid arguments”
Which I dont understand because it isnt even the same format as what I am using. Does anyone know why this isnt working or a solution I can use? Thanks,