Get Location at Spline Point not working with Branch distance

Hello,

Im doing simple AI task where AI moves along spline at random spline points. Im using branch for AI not to choose a point it is currently standing at (distance between AI and spline point, min. 100).

The problem is that it seems it is ignoring branch and it can choose the spline point it standing at (AI just moves a bit). Can someone tell me whats wrong in this simple task?

1 Like

Your call to random integer is being made twice here

So, you’re getting one value, but then calling it again to do the moveto.

If you put the random in into a variable this will not happen.

Thanks it works now. Just a question, when does random int node actually generates number? When task starts or when the random int is being connected and used?

1 Like

It just makes the random number when it’s called ( when it’s pin becomes active ). So, that’s what going on here, the pin activates twice.