I am instanciating templates at runtime and in general the following code works without issue and I get the message LOADED. However with some models I get the NOT LOADED error despite the template existing correctly in the templates folder(this.modelAssetTemplateName).
I cant see much difference between the models, they all have the same type of textures (jpgs), similar texture sizes and all load correctly when I simply drag the templates into the editor.
Is it just not finding the template quick enough? Do I somehow need to wait until the template is guaranteed to be found? How would I do that? Cheers
The assets in general don’t have the behaviour of loading other assets that they are using.
In this case of templates, when loading a template asset, it doesn’t load the model/texture/sound assets that the template is using.
However, when assets are used in the scene and they aren’t loaded yet, the engine will kick off a load of the asset. In this case, creating an instance of the template and adding to scene will trigger a load of any assets that haven’t been loaded yet.
-All the templates do exist and the debug is printing the name its trying to load correctly.
-All templates are set to preload-checked
-If I set any template to Preload-UN Checked it doesnt load
Below is an example of one template that does not get found/does not load/instantiate:
Error (This is the template it is trying to instantiate):
…but we can see it exists in the templates folder here…
Folders are assets as well so after adding a breakpoint on ‘NOT LOADED’ message and looking at the asset, we can see the at the asset found is a folder, not a template: