0
Escalated

2a10 Asset class members cause errors when used in first frame

NeedsLoomis 6 months ago updated by Lazlo Bonin (Lead Developer) 6 months ago 1

I attempted to use assets to make some simple global variable objects, but I found that they don't play nice with functions.

Heres an Asset that holds a Vector3


The Variables are private, I use Functions to get/set them, specifically so I can trigger an event when they change.

Here's the Get Function, very simple:


When I attempt to use the function, I get the following error



I didn't think I needed flow to fetch a variable like that (I could be wrong), but I figured that was the problem, so I added flow and got this error:



Cannot be fetched
https://pastebin.com/wGsR8gPj

KeyNotFound Exception
https://pastebin.com/KcimGSEw

Bolt Version:
2.0.0a10
Unity Version:
2019.3
Platform(s):
Windows
Scripting Backend:
Both
.NET Version (API Compatibility Level):
.NET 4.x
+1
Escalated

Hi NeedsLoomis,

Thanks for the report. I had observed something similar. I renamed the report to be more descriptive.

I have an idea as to what the cause might be. In the editor, the assets get initialized upon play mode entry, but that callback seems to be after the first two frames (Awake/OnEnable/Start run before).