I’ve done that, and the transitions appear to be moving correctly however… Is there a chance that variables in one graph are shared between all instances?
For example, in the below graph, I have 3 AIs in the scene that use it. I’ve made a new Wait between X and Y seconds action that will randomly pick a float, and wait between that many seconds elapsed before returning true. Technically, there should be a difference in action between them; some of them would get out of their Start selector earlier than others.
In a test scenario, I had all three of them on the scene, they all decided to go Idling. Because of the Wait Between 3 and 11 Seconds node in there, two of them finished earlier than the third guy, and went back to the Start selector. So far so good!
Then, one of them finished the Idle Selector action first, which decided that he should go roaming, setting the landState to “doRoam”. All good. I could see from my debug logs that this particular guy actually ran the Idle Selector and got the result he was looking for.
But then, all of the three AIs had their landState set to “doRoam”. Only one of them executed the Idle Selector function, but all three of them transitioned into the Roam state. Obviously this is undesirable behavior, as the Idle Selector action also sets extra parameters in other scripts that can cause things to break if not set properly. Is there something I’m missing?
So far, all the variables were dynamic. I’d just name them whatever inside the graph asset, and then set them inside my actions by calling for example:
blackboard.SetValue("landState", "doBuild");
Is there some step I’m missing?
Attachments:
waitTest.png
Login
Register
By registering on this website you agree to our Privacy Policy.