I’ve tried adding an attack Boolean and setting it up with a behavior script, I’ve tried using blend trees, I’ve tried using sub-state machines. This driving me crazy as I’ve been doing this for the past 6 hours trying to figure it out. HELP!
From the code you’ve posted, you’re only setting the bool to true once and never setting it to false. This will trigger the “attack” state indefinitely, so you have to set it back to false eventually. From what you have commented in your code, you were on the right track, thought I would advise using the actual animation time for the invoke delay.
According to your code
if (Input.GetMouseButtonDown (0))
myAnimator.SetBool ("attack", true);
but your animator setup Imgur: The magic of the Internet is expecting a bool called fire which explains why the its not working. (based on the code you posted) set it to myAnimator.SetBool(“Fire”, true); and it should work.
There is some transition error displayed on the screenshot of you animator window, never came across it, fixing it would be my first step to debug this problem.
Furtheremore to debug this, I would setup game scene window next to animator window and observe behaviore of animator while clicking. Maybe your exit trigger is setup in a way that it exits to the previous animations just after entering it. Make a gif of animator window and post it, maybe this will tell more.