Random integer to branch not working?

Hello! Don’t know why but my random integer sometimes go to false even if it shouldn’t do it! if random integer clamped from 0 to 2 is equal to zero, if become true and spawn an actor, however even if sometimes is zero, it go to false and doesn’t spawn anything.

Should be pretty simple but isn’t working.

Save the random result in a variable first and then use it. That node reevaluates every time there is an execution wire. You’re doing it 4 times here, potentially generating 4 different values.

Well, three, because of the clamp and two, in fact, as RandomInteger[2] returns 0s and 1s only.

You don’t need a clamp.

You can use the “random integer in range” function, plug it into a “less or equal than 1” node, and use this directly for your branch.

Integers are always whole numbers, so for instance the function “random integer in range” with min 0 and max 2 can only return either 0, 1 or 2.

Also: Have you checked if the first sequence pin (0) is ever executed?

thanks for the reply i did all for myself in the same way suggested by @Everynone, i was generating 4 different values that sometimes failed all the branches, storing the random integer in a variable before executing all did the trick! Thanks again!!

thanks for the reply, i managed to resolve this storing all before into a variable! =)