I’m working on a project and checking some values for it. In some case my code start to not working properly, so when i checked it with debug log, its shows different value for one boolean value. Debug log gets it correct but select component gets wrong value like show in picture. How can i fix it?
When you request the output of a value multiple times, it’s reevaluated for each request. UnityVS doesn’t automatically cache values for you.
Try setting a boolean flow or graph variable and then use the value of that for both bool inputs.
It’s interesting. I set graph variables for all multiple outputs and it’s seem working normal. I have one last question: It redo work for each request and probably random value being problem for my situation. so if set multiple outputs for that doesnt have random or getting time stuff, does it work fine?
You might still get unexpected results since the value you’re requesting can change between requests even if it does not include random.range. Some logic elsewhere in the graph or another graph entirely could be changing one of the requested values.
If you’re requesting the same value multiple times in your flow, a good practice would be to use variables or the “cache” node.
