value area around an item

Good morning everyone,

I would like to know whether it is possible to surround an item in an area and to be able to declare minimum and maximum values to that area.
For example: the item is hot and the area is the heat radiation around the item.
Another example: the item is a water point and the area the percentage of moisture around the water point.

Thank you in advance for your answers

No one has an idea about this?

You mean, a gradient?

Yes, a gradient that extends around the limits of a shape, over a given length.

Custom collision shapes around area + distance to origin.

An example, please

If the shapes were spherical or even capsules, then all this would be easy peasy. However, since we are talking about custom shapes and according to the above drawing, the area width (distance between the max and min areas) is variable across the perimeter, I would personally go with discrete, instead of continous values.

For discrete values, it takes just a couple of minutes to setup everything. It’s a question of creating a static mesh component with the custom shape you want. Then add this component, as many as the zones you want to the item. And finally binding the overlap events:



For continous values, that would require playing with collisions, traces and all, and right now I don’t have time to play with all that. Unless the width is constant and known, which in that case, it’s quite easy. You tell me.

The widths would not be constant, imagine earth after rain for example it is wet and dry in the sun. Or the cooling of that same earth at nightfall.

Going further, a measure of time should be incorporated :slight_smile:

I’ll test it and let you know.
Thank you very much for your time.

Hello EvilCleric, all,

I come back to the subject :slight_smile:

Let’s start, if you will, with discrete values, it will certainly be easier to start
Can you give me a little more explanation, please?
As a beginner, I’m lost!

Where the “Cast to Bound” comes from ?

thank you in advance

1 - create the default shape of the boundary (make sure it has collision):


2 - create a static mesh component bp (named it for example Bound), add the shape and 2 variables (in, *out *- check step 4 for why):


Also check to hide the mesh where in game and set the collisions:


3 - create the item bp and a variable Value (this will contain the current field value). The center contains the item and then add as many Bound components as areas you need (in this case only 3):


4 - set the values of *in *and *out *of each Bound component. These are the values of the field inside and outside of that area:


5 - bind the overlaps events for all areas to set *value *to the respective *in *or *out *values:


Notes: I recommend the following to simplify and facilitate all this:

  • use the constructor of the Item BP to automate its creation - where the minimum inputs required would be the number of areas, the default meshes and scales;
  • use Get Children Component and loops to bind the events;
  • remove the *out *variable - there is no need for it.

Thank you for putting that in detail.

I have a result, but unsatisfactory :o

In my “installation” the values decrease or increase from one to the other pat (50=>5, 5=>0). I would have liked it to flow more regularly (1=>2=>3=>4=>5 …).
Moreover, entry and exit are not regular.

I went through a widget, but maybe you have another solution?

I’m starting to see what’s doable with “get children,” it’s complex… :confused:

The example I gave, had 3 zones and flowed from 0=>5=>50=>100.
3 to 5 zones are usually what is used with this method, good for example to simulate an exponential growth in damage.

But if you want something more regular that has like 100 zones, then better go with continous.
But like I said, if the width between the inner and outer boundaries is constant:


and d is know then it’s easy (a simple trace and a couple of vec. ops). Otherwise, …

Here is an example using continuous values, but considering constant width.

We have 2 custom shape boundaries surrounding the item - in and out (as you can see the width aproximately the same between all the 2 boundaries, in this case around 500 units):


The collisions settings are:

In boundary:


Out boundary:


To get the value (considering an int between 0 and 100), we linetrace from the player to the item’s origin, which will intercept the inner boundary. And with that we determine the distance between the player and the inner boundary. Then we use this distance and the width of the area to determine the value:




Thank you very much for your time and your patience with me.
I owe you the truth, I made a mistake assembling the knots. I put a «Bind Évent To on Component begin Overlap» in second position instead of an «end overlap», as you can imagine it did not work very well, hence my questioning.
By fixing my mistake, everything is working perfectly.
I’m still interested in your second solution.
Obviously I don’t quite see how you do it, you talk about «trace» and this with the «break hit» function
results” or similar?

Like demonstrate in my last post, you have 2 boundaries: *IN *and OUT, with a distance *d *between them (I used d=500). Once the player crosses the *OUT *boundary, a linetrace between the player and the center is done, which intercepts the *IN *boundary. From this trace we get the distance between the player and the *IN *boundary.


From that, is just a question of mapping that distance with the values you want. In my previous example, I used the mapping [0,500] -> [100,0], where 100 is when you reach the item and 0 when you are out of range.

In order to understand the meaning of your sentences, I tried to find tutorials which could have explained to me the principle of “mapping”, put here I could only find tutorials telling me about the creation of terrain or so of reconfiguration of the keys and movement function, nothing that relates to what concerns us.

I am a bit too beginner to know which nodes would be useful when starting my business. This is why I ask you to be lenient towards a “newbie” and to kindly give me an example of Bleuprint so that I can glimpse the beginning of a glow that would allow me to direct myself in the darkness of my ignorance. :o

Not speaking english, i have to use a translator and the youtube one is not the best

thanks in advance :slight_smile:

Take your first pic of this thread. Let’s imagine that the green zone is a radioactive area, where its value goes linearly from 0 to 100 (max radiation level - the closest distance to the item).


Let the distance between those 2 points be 500 units.

Now, our goal is to determine the value of the radiation at any location between those 2 points:


Basically, we need a function that given a distance 0<x<500, returns a corresponding radiation level between 100 and 0.

How do we calculate it? Two ways:

  • manually (too much extra work)
  • using the “Map Range XXX” (quickest option). From the example I gave earlier:

](filedata/fetch?id=1809488&d=1599588785) ​

If you already used progress bars widgets, then you probably already did some mapping operation, where, for example, you had to transform your health value, that goes from 0 to 100, to a value between 0 and 1. Same principle.

Ok, I’m starting to see more clearly.
A problem persists, at the end of “round” my value remains at 0.
I wonder if there might not be a variable to declare in the player, but I do not see any in your diagram.
Another thing escapes me you bring the player out of the “Out” zone, but we don’t see an entry in the “In” zone.

I have not yet had the opportunity to use a “progress bar”, I know absolutely nothing in this area, but I intend to educate myself, with your help, here and on tutorials. Know that I am progressing faster with you :wink:

Nothing to add to the player.

Are the overlaps events triggered?

Show pics of the BP, of the event graph and the viewport.

That’s up to you. You get into the Item zone, then what?

Colision In :


Colision Out :


Bleuprint and Graph :


Viewport :