Why does Int to String and String to Int get different results?

I am generating a random integer in range of 100 to 999, then I convert it to a string. Shouldn’t it be the same?
Here is the blueprint:

Here is the result:
Screenshot_59

Am I doing something wrong or is there another way of doing it?

That is because you are executing the generate random node twice.

Try this: save the result of the random node to a variable, then use it to print and compare.

1 Like

Thank you! It works now… I’m new to UE.

1 Like

Additional info: Green nodes are “Pure” methods which do not execute through exec pins. This means that they will execute for every time a pin is accessed. Methods which are not marked Pure (and are executed with the execute pin) do not run every time an output parameter is accessed.

2 Likes