Most of the Coroutine plays out the way it should. The only problem is the AudioSource deathScream, it doesn’t immediately play when the coroutine starts and sometimes it doesn’t play at all. Is there something I’m missing with my code? I look forward to an answer.
When your health drops to zero or below, you will fire the Death coroutine every single frame, and if you play an audiosource every single frame it keeps trying to play the clip from the beginning, but never gets a chance to play through it
You need to only be calling that Death coroutine once, so use a flag to determine whether they’re already dying or not.
Hey brotha, just to let ya know I finally got it to work. Apparently the real problem was that my health variable is static and is being updated, so I just made it a normal float instead. Thx for the help tho.