Is Get Random Reachable Point In Radius not evaluated twice?

I have a question regarding following image.

How can i use both the Location and the Return Value.
Given that it is two exec nodes, will i not, when i have used the Location, get a new location in the brach node where i use the Return Value as the function has been run again, thereby getting an answer if the new location is valid and not the one i already used?

If i reverse it, check first and then use, i run in to the same problem do i not?

So how do i “save” both location and result so i can use both of them for my further progress?

As i can see, i would need to create an empty non-pure function so the results does not change, that just seem a strange way of solving it.

Or can i safely run the above code and know the RandomLocation and ReturnValue will follow each other?

you’re right that pure functions are called twice but it wont change the location that you’ve already sent to the blackboard.

also these calls would be instant so nothing would change anyway.

it would be better to reverse the order because why update the blackboard if its invalid?

or, and im assuming here an invalid location would return (0,0,0) so if you only want to call the function once, cache the variable and check if it equals (0,0,0)

Its more, will i not get 2 different eveluations. So i might save the location, but when checking if its valid, it is a new evaluation meaning it checks for a new location, leaving me to not knowing if the saved location is valid?

If i reverse, i will check if a position is valid, but when i save a the location to the BB its a new evaluation, meaning new location, meaning i cant use the previous validation as it has nothing to do with the new location?

thats what i meant when i say these calls are instant, the frame hasn’t changed, nothing has moved so they will return the same result

Don’t think that is correct. If i call it 10 times in the same function and place an actor to these locations, i get 10 actors placed at different locations. So i can’t see how as long as i call in the same “frame” i will get the same result.

Pure functions is not about whether a frame has passed or not. If i set something and i get the var immediately after in the same call, i will get the new var as it has changed, don’t need to wait a frame to get the new value. As per this post, it seems like pure functions gets recalled once pr. exec node that has passed. So in the above, since i use 2 exec nodes, i call it twice getting 2 different results.

sorry your right since its returning a randomised value, like i said just save the Vector and then verify yourself if the vector is valid, which it will be if its not (0,0,0)

Ahh, that makes sense to validate it like that :slight_smile: Thanks a lot for the advice.

good pickup though, i hadnt thought of that particular node in a while, there used to be a different non pure node but now i cant remember what its called. i wonder why they changed that

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.