Change URL in config file to variable

Hey everyone,

I am downloading my PlayCanvas project and trying to change the URL to an image in the config.json file to a variable containing another link. However, I cannot directly use a variable in a json file. Is there a way I can link the variable, defined in a js script and then call the actual image(not the variable) from the script in config? I cannot rebuild my project to engine only due to time and other constrains.

Help would be greatly appreciated.

If you are using a build system, you would have to step up a step where you replace the variable in JSON with the actual data of the variable.

Or you can modify the config loader to look up the variable data when it loads the config.

1 Like

That’s what I really need @yaustar. Could you please tell me how I would do that?

Sorry, I haven’t done this before but it would be one of the approaches I would look into if I was doing this.

1 Like

Ok. Thanks for your assistance.