@marty said:
Heya, TT!
I want to export the variable so that it is populated via the inspector. I always prefer linking resources via the inspector because they are less likely to break (ie. when renaming linked nodes, etc.) and when they do break, you don't have to go digging into scripts to fix them. Inspectors rock. ;-)
Hey Marty!
Thanks for explaining the use case!
I was just wondering because I have never needed to preload any exported assets before, but part of me was wondering if I am doing things the 'wrong' way so I never came across it.
(Side note: Not to say that I think there is no 'wrong' way, just different ways with different pros and cons, but I am always trying to learn new things)
I do generally rely on having exported variables for the very same reason: They are easy to fix if they break, and you do not have to change hard coded values when/if they break.
Another added bonus I found with exported variables is you can easily make a bunch of variation on a bunch of different scenes just by changing the values, which is super handy when you have multiple things that all (more or less) act the same with small variations as you can use on script for all of them. :smile:
But, I need to explicitly preload because the asset that I'm having trouble with doesn't appear to be preloading. Like you, I thought export-linked resources were inherently preloaded, but apparently not so, as I have one now that clearly hiccups the project the first (and only first) time it is instanced.
Perhaps a issue/feature-request should be opened on GitHub to add this functionality?