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"

HUD opacity by range from enemies

Trying to set up a HUD that shows up when near an enemy AI and goes away as you move away. Trying to set it up as a slow progression as a percentage. Currently I have set up that only slightly works as it climbs as I both move closer and further away.

Goals of Blueprint:
1. Detect AI range from player
2. Give HUD widget range to change opacity level


Product Version: UE 4.17
sg-range.png (145.5 kB)
more ▼

asked Jan 18 '18 at 03:01 PM in Blueprint Scripting

avatar image


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

1 answer: sort voted first

Hey there, usually to get the distance you subtract one location from the other. You can also use the node Get Distance To instead of doing that. The enemy distance variable will hold the value between 0 and 1 (it might surpass that but thats not problematic i would say, worst case you can clamp it from 0 to 1) so in your umg widget you set the opacity to the value that comes from that variable.

more ▼

answered Jan 18 '18 at 03:07 PM

avatar image

6k 161 129 304

(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