Hey guys! I know it's kinda early in the season for code issues, but I've got a question about toggle code. How come this:
Code:
bool Toggle, Button2Value;
Button2Value = false;
Toggle = false;
if(stick1.GetRawButton(2))
{
if(Button2Value == false)
{
Button2Value = true;
Toggle = !Toggle;
}
}
else
{
Button2Value = false;
}
would not change the value of Toggle afterwards? the idea is that button 2 can be pressed for an unlimited amount of time, then let go and the value of Toggle would be switched, until it was pressed again for an undefined amount of time. However, whenever I run it the Toggle variable never seems to change value. If the rest of the code is required, just ask and I'll post it.