IF node condition using distances

Hi all,

I need to do a simple check within Blueprints, but I’m having some difficulties.

Basically I’m checking the distance between two objects, lets say that the distance is 20 between them, and when one of them moves the new distance is 35.

It can happen that the distance between them is less then 20, and here is the problem.

What I would like to do is to set an IF condition, where if the distance between the object is less then 20 the return value will stay at 20, instead of giving me 16 or 17.

So I’m comparing the two values with a less then node, where the first input is the realtime distance between the objects, the other one is 20.
At this point what I would like to do is to set a true/false condition, where:
True: value is higher then 20 > output real distance between the objects
False: value is less then 20 > output 20 as a value

I searched inside the blueprints ( Branch node, if node, and so on ) but I haven’t come out with a proper node or solution

Could you guys help me out please?

If less than 20, then Set some variable to 20. Then use that variable wherever you need it.

You could use a Max node with one input being your distance and the other 20. The node would then output 20 whenever your distance is below 20.

It totally worked with the Max/Min node:)
Thanks both of you guys :slight_smile: