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
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);
}
}
}