Get the individual distance of all actors of class.

Hi!

I want to know the individual distance for all enemies to the player so I can put those values equal to a distance parameter I have set up in Fmod. I just need the numbers.

I really cant seem to figure it out…

PLEASE HELP!

Use the node GetActorLocation on each enemy and the player. Then you can do this:

(enemyLocation - playerLocation) → VectorLength

The locations are the result of the GetActorLocation and the result of the subtraction is fed into VectorLength.

Like this:

http://puu.sh/r6IIp/e50855d2fe.png

Thats pretty much what I did but it still doesnt work. It works if I create the function in the Player BP. It prints ALL the enemies Vector Length. But I need the individual numbers for each enemy.

When I blueprint the method in the enemy BP it doesnt work for some reason?

Please convert this answer to a comment. You do this by clicking on the down arrow at the bottom.

What do you mean you need the numbers for each enemy? Some ID number? Some way to store the data on each enemy?

Oh, sorry.

Yea, the distance value. I need to know how far each and every enemy is from the player. With that value, I will set it equal to aa distance parameter in Fmod. Different sound at different distances.