an issue using onended
using onended for my sounds, sometimes it runs the damage after the sound, but for a lot of it, it doesn't wait for the damage to finish.
All I'm doing is this line:
attacksoundSFX.play(); attacksoundSFX.onended = opAttack(2);
Any Help is appreciated
you actually just called the function instead of assigning it to be called instead. Please assign a function for a function to take effect!
attacksoundSFX.play(); attacksoundSFX.onended = () => opAttack(2);