how do I get my inpector variable to toggle between variable in code

the code does only allow one variable at a time to be true, but in the inspecter the user could choose several at the same time. of course that user wouldn’t get several, but only one.
How do I code it where when the user clicks on a bool var in the inpecter that and only that one would be checked? if there was one checked aready then that would become unchecked.

function Start ()

{

if(isUsingE)
{
	isAutomatic = false;
	isLeftClick = false;
	//set isUsingE = true;
}

if(isAutomatic)
{
	isUsingE = false;
	isLeftClick = false;
}
if(isLeftClick)
{
	isUsingE = false;
	isAutomatic = false;
}

audio.volume = Volume;
}

1 Answer

1

Use an enum and convert your code to a switch statement. Easier for you and the user :slight_smile: