Hello. I have a weird problem. I would like to spawn traffic cars at specific distance from the player. The problem is that cars are spawning too close to the player. It looks like “Is grater than” node is just ignored somehow. How is it even possible that it printed the string I show on screenshot? I am sure that I will find a workaround, and I will use different nodes, but I think it’s weird that such a basic node can fail. Or maybe I am not seeing something?
Are you using a random node on the left of the screen where we cannot see?
Yes I do. “Random float in range” node. You are right… I think I got it. It randomizes different numbers for “print string” node.
That’s the issue, it’s an old trap.
Every time you evaluate a random, a new random is generated. So you evaluate once for the Branch and then a second time for the Print. Both evaluations are done separately and produce 2 different results.
If you need to use 1 randomly generate value more than once, store the result in a variable first.
Thank you. It’s all coming together now.