ParticleHelper.LoadASync loads textures from

I have a custom .json file saved locally that defines my particle system.

When I set ParticleHelper.BaseAssetsUrl to my local public folder the json loads fine but then the texture that is defined as “textureName”: “flare.png” in json file is trying to load from even tho BaseAssetsUrl is set to my local directory.

To the level I was able to understand the source code, static variable BaseAssetsUrl is only used in ParticleHelper class and when the json is loaded end sent to ParticleSystemSet parse method there is no reference to BaseAssetsUrl. The parse methods always takes Constants.PARTICLES_BaseAssetsUrl value. I think ParticleHelper.BaseAssetsUrl should be injected into Parse methods for ParticleSystemSet and ParticleSystem classes.

I was thinking to change Constants.PARTICLES_BaseAssetsUrl but this seems like to much of a hack…

Please help.

This is not a hack but the expected way actually :slight_smile:
Just call BABYLON.Constants.PARTICLES_BaseAssetsUrl = ...

1 Like

Yeah, it was so simple! I’m stupid, I went into babylon.min.js source and changed variable there did not even come to mind to just do this hahah.

No worries!

Actually, now I tried this solution but it seems it doesnt work. This is a read only property so you cant change it programatically. Any way around this?

My bad! I’ll remove the readonly property for next commit !

You can cast it to any in the meantime