I was trying to have a system where it bumped up the variable by 1 and then looped when it hit 4

I was trying to have a system where it bumped up the variable by 1 and then looped when it hit 4, but the code that I wrote didn’t work, and I don’t see why. It’s not a matter of the way of activation, because I log whenever it should activated the function.
My Code:
void SwitchElementF()
{
if (SwappedElement = false && Element == 1)
{
Element = 2;
SwappedElement = true;
}
if (SwappedElement = false && Element == 2)
{
Element = 3;
SwappedElement = true;
}
if (SwappedElement = false && Element == 3)
{
Element = 4;
SwappedElement = true;
}
if (SwappedElement = false && Element == 4)
{
Element = 1;
SwappedElement = true;
}
}

It would be helpful if you posted your code in a code block instead of directly into the comment area, just for future reference. What you’ve created is a very complicated and messy if statement. Try something like this. By the way, I’m only guessing what your are trying to do based on what I can see here.

if ( !SwappedElement )
{
	SwappedElement = true;

	if ( Element < 4 )
		Element++;
}