x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Get the individual distance of all actors of class.

alt textHi!

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!

Product Version: UE 4.10
Tags:
skärmbild (37).png (268.8 kB)
more ▼

asked Sep 10 '16 at 08:15 PM in Blueprint Scripting

avatar image

ErikJacobson
1 1 1

avatar image ErikJacobson Sep 10 '16 at 09:56 PM

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?alt text

avatar image NoobsDeSroobs Sep 10 '16 at 10:02 PM

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?

avatar image ErikJacobson Sep 10 '16 at 10:08 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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: alt text

more ▼

answered Sep 10 '16 at 08:30 PM

avatar image

NoobsDeSroobs
2.7k 107 35 180

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question