Hello everyone... I'm working on a platform game
And in the game, I have two types of enemies...the first one attacks repeatedly every period of time (in loop) ...and the other attacks you when you approach it only using the (line of sight) behavior.
I want to add an attack sound for the two types of enemies when they start their attacks
And that the sound appears only when the enemy is visible on the screen, and it is muted when it is not visible.
Also, the sound of the attack should not be repeated several times, but only once during the animation of the attack
I hope the idea is clear to you and thank you in advance.