Ashley I was wondering if this is expected behavior? or if i should file a bug for it, so basically inside a trigger i am create some spritefont instances inside that same trigger after the spritefont instances have been created i set some properties, then i call a function. inside that function i am just trying to log all the instances of the sprite font to the console. those 2 arrays always come back empty when using getAllInstances, if i use getFirstInstance that reference comes back null, if i add a wait 0 seconds before calling the function those objects are then logged as expected.
I did a bit more testing and moved the java script block inside the trigger, and got the same result it seems like created instances are only available in the java script api on the next tick after they are created
so i got a bit more curious, and i tried to execute the javascript on the on created trigger for the sprite font, and that also came up with the same results... empty array
when creating instances in events and trying to modify them through the javascript api are there any other ways to access the created instance in the same tick? or is wait 0 the recommended approach. would it be possible to attach hooks on the life cycle of an instance, like we have hookson the lifecycle of layout?
runtime.object.Instance.oncreated = () => { ... }