value area around an item

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

0.jpg](filedata/fetch?id=1808868&d=1599454709)

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):

](filedata/fetch?id=1808869&d=1599454756)

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

12.jpg](filedata/fetch?id=1808873&d=1599455525)

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):

](filedata/fetch?id=1808870&d=1599454798)

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:

](filedata/fetch?id=1808871&d=1599454952)

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

](filedata/fetch?id=1808872&d=1599454962)

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.