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"

displaying a distance hud

Hi, I am new to UE4, i am just wanting to create a HUD system which will show me the distance and direction of the objective with the player as seen in the assassins creed or splinter cell. Here, notice the green "12 W" on the left of the image. Thanks in advance! https://i.ytimg.com/vi/YuhfD48VRGE/maxresdefault.jpg

Product Version: UE 4.18
more ▼

asked Jun 14 '18 at 03:27 AM in Blueprint Scripting

avatar image


avatar image IndieGameCove Jun 14 '18 at 05:52 AM

So this is just an educated guess,

get the distance between the world location of your player and the objective. I think the units are in centimeters. https://answers.unrealengine.com/questions/11053/getting-distance-between-two-vectors-in-blueprint.html

for direction plug the world locations of player and objective into the 'unit direction node', then feed the output to the 'rotation from xvector'. then you need to compare the z value. it has a range of -180 to 180 not 0 to 360. So if the value of true north is 0 if the z value is between 45-135 that be east, I think... https://www.youtube.com/watch?v=_JCWLsRyz0Y https://www.youtube.com/watch?v=yaVKOwaMoLY

you're going to be setting all this up in a widget blueprint and casting to the player and maybe the objective to get there locations.

hope that's at least half way coherent.

btw look up the "print string" node, it's useful for debugging

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

1 answer: sort voted first

try this in level blueprint

![alt text][1]

distance.jpg (123.7 kB)
distance.jpg (123.7 kB)
more ▼

answered Jun 14 '18 at 05:45 AM

avatar image

38 3 8

(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