I am setting up an NES-style brawler. I have a boolean for my animation called "attacking" as I want this to function as though a turbo button is enabled. If the button is held down, just keep attacking.
I am at a loss as to how to recognize when the player stops pressing the attack button.
I am still learning the input system, and I don't truly understand it. Reading the attack button when depressed is working. Bimmy does start punching. He also starts and stops moving with the proper animation. However, I cannot seem to stop the attack loop.
public class Bimmy : BoxCharacter
{
...
public InputActionReference attack;
...
void OnEnable()
{
attack.action.started += Attack;
...
}
void OnDisable()
{
attack.action.started -= Attack;
// Animator().SetBool(Anim.attacking, false); // I tried this, but it didn't work. I thought this is where the input is no longer depressed, read diabled. This clearly is not the case.
...
}
void Attack(InputAction.CallbackContext obj)
{
Animator().SetBool(Anim.attacking, true);
}
}