Search Unity

possible bug? Input.GetButtonUp and animator.setbool not triggering

Discussion in 'Animation' started by corypi, Jul 19, 2022.

  1. corypi

    corypi

    Joined:
    Jun 9, 2022
    Posts:
    36
    hi guys i have this section of script
    Code (CSharp):
    1. if(Input.GetButton("Fire1") || Input.GetButton("Fire2") || Input.GetButton("Fire3"))
    2.         {
    3.             currentState = PlayerState.attack;
    4.             attackingScript.aboutToAttack();
    5.         }
    6.         else if(Input.GetButtonUp("Fire1"))
    7.         {
    8.             animator.SetBool("tailwhip", true);
    9.             attackingScript.Invoke("aboutToAttack", .28f);
    10.             currentState = PlayerState.idle;
    11.             animator.SetBool("tailwhip", false);
    12.             Debug.Log("full if ran");
    13.         }
    where my bool is not being updated.
    if i move the bool to the Input.GetButton then the bool triggers fine as well as if i move it out of the else if to my update() it also triggers it will not trigger inside of my GetButtonUp despite my Debug printing correctly to show that my entire if statement ran.
    is this a bug? or am i doing something wrong(i tried commenting out my invoke call)?
     
  2. corypi

    corypi

    Joined:
    Jun 9, 2022
    Posts:
    36
    it was the invoke function causing a issue i wanted to utilize its "delay" vs a coroutines wait for seconds. everything works fine in the coroutine however still unsure if bools not being triggered while invoking is a bug or not