Comparators (<, >, <=, etc) not behaving as expected

I’m very confused and I feel like an idiot but here goes:
Trying to compare A<B (or any other variant I could think of, it seems to return true or false randomly and I’ve got no idea why.

In this screenshot there is a 1108.554304 < 1000 : true, but I could take a random screenshot and have something like 540<1000: false just as well


UnrealEditor_vhh8XrTM25

pure nodes (those without the white execution pins) are executed every time they are used, meaning the branch and the print strings will receive different sets of numbers from the random float in range node.
If you want them to work properly you need to store the result of your random float in range in a variable before using it.

2 Likes

alright thanks a bunch, I thought I was going crazy there!

Yes, the confusion is caused by random floats, not comparisons

1 Like