activating object only on true

so what I’m after is if current mana <5 cant cast spell if >5 can cast spell. kinda new to programming and any help would be appreciated thanks.
if you need my whole code let me know :smiley:

this is my little attempt at what I am after.

bool activateShield = false;
public float current mana = 100f;
public GameObject Shield;

            {
		if (currentMana >= 5)
			activateShield = true;
		else if (currentMana <= 5)
			activateShield = false;
	                                                                      	                                                                 
		if (Input.GetKeyDown (KeyCode.LeftShift))
			activateShield = true;                                
		Shield.SetActive (true);

		if (Input.GetKeyUp (KeyCode.LeftShift))
			activateShield = false;
		Shield.SetActive (false);
	}
}

}

nm worked it out ended up using a else if statement instead and worked great :smiley:

	{
		
		if (Input.GetKeyDown (KeyCode.LeftShift) && currentMana >= 0)
			Shield.SetActive (true);
		else if
			(currentMana <= 0)
			Shield.SetActive (false);
		

		if (Input.GetKeyUp (KeyCode.LeftShift))
		Shield.SetActive (false);
	}
}

}