::Ah alright, after taking another look and your confirmation on holding the button.
The reason you’re still firing the DarkBullet spell despite you not being supposed to by code. I’ve found that your castOrhealTimer
isn’t actually changing in getInput()
. due to the line being slightly incorrect.
Just add a +
in castOrhealTimer = Time.deltaTime
void getInput()
{
xAxis = Input.GetAxisRaw("Horizontal");
yAxis = Input.GetAxisRaw("Vertical");
attk = Input.GetButtonDown("Attack");
if (Input.GetButton("Cast/Heal"))
{
castOrhealTimer += Time.deltaTime;
}
else
{
castOrhealTimer = 0;
}
}
Then do tell whether it works now.