This just did not work for me at all :(

I don’t even know where to begin debugging. My gun object has the animation controller and when I select it and play the Fire animation in the animator, the animation plays correctly in the scene view. I don’t get any errors creating the hash, and I’ve confirmed the FireAnimation function is firing.

I’m stumped.

Hi Hazel,

I possibly need some more coffee this morning but i am trying to understand where the bug is in your project.
It sounds like you are saying that the animation plays when you play it via the animator and it plays in the scene view but when in play mode its not working?
Can you provide some screenshots of the code, The link up in the inspector and if possible a short video of what you are seeing.
I know you are pretty experienced in using unity so i am pretty sure your code will be correct but maybe somewhere its not linked up correctly as i have done that myself in the past (Even forgot to add the script to a gameobject before!)

If all else fails i can get a copy of your project and try to have a look directly as a second set of eyes can often help.

sorry, looks like my update didn’t post. I figured out the problem. I had my firing cooldown check inside the shoot projectile function and hadn’t moved it when we changed to using subscribed events, so while the gun was firing the projectiles correctly, all other subscribed events were firing every frame while the mouse was down. So the animation was firing… the first frame, every time :grinning:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms