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"

Calculating distance from actor/order of appearance

I have three actors stood in a line inside a box trace of a static object. One of the actors is the player pawn and the other two actors are children of a master actor class. What I'm having trouble doing is detecting what order the actors are stood in. I can calculate the distance from two objects by subtracting the locations and breaking the vector to get the Z distance, or I can split the locations and compare the Z locations, but what I can't seem to figure out is how I compare all locations of each actor that enters the static objects box trace to find the order they are stood in.

What I am trying to do is increase a variable depending on how far away they are from the object. +1 for the closest, +2 for the actor behind the closest, and +3, +4 and so on.

Product Version: UE 4.16
more ▼

asked Sep 06 '17 at 02:54 PM in Blueprint Scripting

avatar image

7 2 3 5

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

1 answer: sort voted first

Hi, you can just use a node called "get distance to" to get the distance between actors. It returns a float value, then you could compare those using some less thans and make something happen on the result of that. I hope that helps.

more ▼

answered Sep 06 '17 at 06:38 PM

avatar image

6 1 3 7

(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