::Terence,
I tried the elif statement in my GetInputs function, but I was doing something wrong, because it was still resetting the castOrHealTimer to 0, before it checked the value, and thus casting a fireball after the heal.
//this is what I tried but couldnt get to work.
if (Input.GetButton("Cast/Heal"))
{
castOrHealTimer += Time.deltaTime;
Heal();
}
else if (Input.GetButtonUp("Cast/Heal"))
{
CastSpell();
castOrHealTimer = 0;
}
//this is what finally worked for me
if (Input.GetButtonDown("Cast/Heal"))
{
castOrHealTimer = 0;
}
if (Input.GetButton("Cast/Heal"))
{
castOrHealTimer += Time.deltaTime;
}
I don’t know if this will cause any issues down the road, but its working better than my last fix, which was to reset the timeToCast variable in the healing function. Thank you for the help!