- Home /
Animator Parameters Not Changing
So this code works fine when i call "FirePistol", it makes the transition waits till the end of frame then changes back (the animation to change to is on exit time). Using ""print(animator.GetBool("Fire"));"" i can see the bool is behaving correctly.\
then "faceplant" i go into the animator tab so i can see how great it is that everything is working, but no. as soon as i change tabs then run the function "FirePistol" (which is called over the network) the bool refuses to reset, i know the IEnumerator is called but for some reason while being in the animator tab makes the bool stuck on true, switching back to game of scene tabs does not fix the issu, i have to restart the game.
if(Input.GetKeyDown(KeyCode.H)) { animator.SetBool("Fire", false); }
for some reason if i use this code and press h while in the animator tab it sets it back to false.
Please, WHY can being in a separate tab change how the animator parameters act?
Thanks
public void FirePistol()
{
animator.SetBool("Fire", true);
StartCoroutine(ResetStates());
}
IEnumerator ResetStates()
{
yield return new WaitForEndOfFrame();
animator.SetBool("Fire", false);
}
Your answer

Follow this Question
Related Questions
Separate class for control parameters in animator 0 Answers
Parameter walk does not exist 0 Answers
Animator subtracting float to change states in c#? 0 Answers
Play animation while button is pressed fails when using boolean parameters. 1 Answer
How to access animator parameters with out name/string? 0 Answers