Hey guys my change level throws error due to 403 error (forbidden)
How can i solve this problem?
Hi @smokys,
It seems the scene isn’t available or missing, are you able to share a project url with the problem?
When i play game through editor everything works fine, this happens when i build the game
https://playcanvas.com/editor/project/745540Y
You can try level 2 for example and on finish it will take you to another level, but when you build game it throws error
Which script files should people be looking at and how do we reproduce the problem?
Sorry, it is onFinishEnter.js
in global folder
The issue is that the url is not passed to the function loadSceneHierarchy
, it’s only given the id. While this works in the Editor, it won’t work in builds because the URL for the scene is a JSON file.
If you change it to:
this.app.scenes.loadSceneHierarchy(this.sceneName+'.json', function (err, parent){
That should be enough to make it work.
Do you have somewhere else where you load scenes in code? And is this a new build too?
Its also in folder Level 12 - Bonus -> finishEnter.js
edit: i try to build project but it keeps loading
FIXED, your updated code was right, it was my mistake, SOLVED