it's possible play a music when you see a enemy(see int he screen)

Hi all…
I said all in the title

There is no a way?

Of course there is a way. You need check the distance between you and enemy. When it is less than X then you start the music.

Check the Raycast functions.
Cast a raycast every X ms from player to the enemy, if true play music.
Maybe check the distance like vegetamaker said, so it doesn’t play if he’s far in the distance.

i resolve thanks to all <3

Hey siengried, can you share the solution you found for this? I’m investigating this right now :slight_smile:

i follow a video can i share it?
btw the name is Unreal Engine 4 Tutorial : AI Navigation - Chase and Roam
Of totally unreal
Btw i didn’t solve ahahahha
I created a monster that walks for the level
http://s28.postimg.org/ersh6tint/Immagine.jpg
and when he see you he chase you
http://s22.postimg.org/vpqcgd8u5/Immagine.jpg
Now i put the play sound but the sound is ever played so many times and not 1 times and why when i shake off the monster he stop to roam?

Please help me ç_ç

there is no a way so?

Check the next links. They should give you an idea how to do it:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/index.html
https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/Transformation/GetDistanceTo/index.html