Download

Play sound when AI character stops moving

Hello guys I am trying to make some animals make noise when they have moved to a random location and are waiting for a few seconds, but I do not quite know how to do it. Can anybody teach me? The animations are set and there are speed and direction variables. I tried to play sound using the behavior tree but it’s not what I want since it plays a sound that can be heard anywhere, what I want is hearing the sound when I’m near the animals.

How are you playing the sound? Are you using the Play Sound node? If you do, then you shouldn’t be earing it everywhere, unless the sound file has attenuation disabled or a very high falloff distance.

1.png

I solved the problem, I forgot to put in attenuation lol, thanks

To do this you need to create a boolean that says stop moving and then branch, so when creature stops moving then play sound if creature is not moving.
If you need more help. please let me know.