The new Unity loader has removed compatibility with a WebGl build in Salesforce. The following error occurs :
Uncaught SyntaxError: Unexpected token <
which follows with:
unityLoader[id] is not a function
at UnityLoader.loadCode.Module (UnityLoader:95)
at HTMLScriptElement.script.onload (UnityLoader:27)
I have been able to determine that it is due to some url issue which causes salesforce to send a url not found page back, triggering the < of the HTML doctype to fire.
Could anyone give me some help as to how to debug/fix this as Unity 5.5 works perfectly!
Yes I have used the template, well I have copied the correct code and hosted the JSON file with links to all other files. I think it is due to Unity trying to create links to instances of itself or something like that, can anyone advise?
Hi Marco, thanks for the reply, I believe I have set everything up correctly as specified in that link as the links to the files are successful and Unity does load to the point that the loading bar is filled to about 70-90% for a split second before failing. This is my page:
The url refers to a page which generates the json required at runtime producing this:
{
“TOTAL_MEMORY”: 268435456,
“dataUrl”: “resource/1492022171000/BuildData/Build.data.unityweb”,
“asmCodeUrl”: “resource/1492022171000/BuildAsm/Build.asm.code.unityweb”,
“asmMemoryUrl”: “resource/1492022171000/BuildAsm/Build.asm.memory.unityweb”,
“asmFrameworkUrl”: “resource/1492022171000/BuildAsm/Build.asm.framework.unityweb”,
“splashScreenStyle”: “Dark”,
“backgroundColor”: “#222C36”
}
Do you have any further advice about making the new WebGL compatible with Salesforce and is there any plans to support cloud platforms such as this as we are very interested in getting a pro licence and staying with Unity for a visualisation engine when we goto deploy.