Why does the integer change when calling an event?

I have a very stupid problem.
I have a spectator pawn, which should fire an event in certain object in the game world. It should also give it an integer value.

But the final value doesn’t match the first value at all.


So, if “Move” is equal to 3, “Turns” can be equal to 5. They behave like they don’t depend on each other at all.

Random nodes generate random values every time they’re called. In your first BP, it will generate one value for PrintString, and another value for DiceThrownEvent.

What you want to do is save the random value to a variable first, and then use this variable instead of calling the random node.

1 Like

If you want to get more info about this there is an good article by Celdevs/ Salty Panda Studios:

1 Like