Loading JSON for Lottie animations

Wanted to do SVG animations, couldn’t find a tool for that, so I made some Lottie animations, figured I could import it via CDN, and I could! Managed to get up and running a Lottie file saved in an external server, great, now I just have to load my own JSON from my project files but…

It seems that studio is not uploading JSON files to server, I’ve tried import *, request() , ecs.assets.load(), directly putting the file address and in every case it fails to find the JSON , that’s why I got to the conclusion that it is not uploading.

Am I correct or is there another way of importing a path to a file? I can’t put the JSON as a JS dictionary directly because Lottie expects a file path in every case.

Thanks in advance!

Ps: if the feature is not supported then this would become a feature request I guess :relieved_face:

Quick update on my own issue, I managed to get lottie animation working using the JSON as dictionary directly from my .ts file. It works, it does the job, but it’s still extremely frustrating having my jsons directly on my .ts, so this does becomes a feature request, please let json upload to server, thanks!

You could upload the JSON file as a single file asset bundle. I haven’t tested this specific use-case but it should work.

1 Like

Smart, I did not remember about the existence of asset bundles. Yeah it should work, for the meantime I made an animations.ts that exports all the anims on an array as json - js dicts, that way is easy again to manage the animations.

Some other time I’ll give asset bundle a try, thanks George!

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.