So I have a project which includes various 3D Avatars that are big in Size. Older iPhones have the problem that they crash safari when too much RAM is used. So I am unloading the assets of avatars I am not currently showing and then loading them again whenever I need them. This works fine, except for morphs in animations.
I have two examples here:
In this example, the morphs are first loaded correctly as you can see by the blinking and the mouth animation better. Special about it, is that the assets have “Preload” on. You can then click the button “Unload” to unload all the assets of the avatar, and then press “Load” again and you will see, that now the morph animation has been lost. When unloading and then loading again while debuging with “Launch” I receive the following error (which is not shown in published builds):
morph-instance.js:197 Uncaught TypeError: Cannot read properties of null (reading '_targets')
at MorphInstance.setWeight (morph-instance.js:197:55)
at Array.func (default-anim-binder.js:94:47)
at AnimTarget.callSetters [as _set] (default-anim-binder.js:104:39)
at AnimEvaluator.update (anim-evaluator.js:264:35)
at AnimController.update (anim-controller.js:582:29)
at AnimComponentLayer.update (component-layer.js:257:26)
at AnimComponent.update (component.js:732:28)
at AnimComponentSystem.onAnimationUpdate (system.js:84:31)
at ComponentSystemRegistry.fire (event-handler.js:201:26)
at Application.update (app-base.js:1171:22)
In this example I do not preload any of the avatars assets and here the morph animations never seem to load. But this also does not throw any errors in when Debugging.
So how do I set it up correctly in order for morph animations to always be loaded correctly. Are there certain assets, that I am not allowed to unload and must be preloaded in order to work properly?
If anyone is interested, I can provide read access to the project.