0
Not a Bug

Strange values evaluation timing

sumibi-yakitori 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 1

I'm using Unity 2017.4.6f1 and Bolt v.1.4.0 (.NET 3.x).

I think that acquisition of the value when using the `Wait until` unit is strange.
In this flow '@Hanica' game object spawns a few seconds after the scene starts.


I made the following changes to fix this bug.


Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+1
Not a Bug

Hi sumibi! I can see why that would be confusing, I'll try to explain what's happening.

Basically, because the control ports (arrows) of Game Object: Find are connected, Bolt will only fetch that value when you specify it (e.g. on Input > Enter in your graph).

If you want it to dynamically fetch it every time, you can have a much simpler graph than the fix you tried. 

  1. Disconnect the connection between Input: Enter and Find
  2. Connect Input: Enter to Wait While directly instead
  3. Keep your connection between Find and Set Local Scale

Something like this:


To be very precise technically, the problem is that local values for port caching exist on a per-flow basis, and the wait until unit creates a new flow as a delegate. Therefore, it doesn't have the same "scope" as your set local scale.