Switching to big scene instantly

Hello
Right after my loading screen I have a small scene that is a 10 seconds animation when this animation is over I want to switch to a different much bigger scene.

My problem is that there is a couple of seconds delay before the bigger scene displays properly.

How can I switch between two scenes seamlessly / instantly.
Is there a way to preload everything during loading time ?

You will need to profile in browser devtools to see where the 2 seconds delay is coming from. Eg shader compilation, is it waiting on loading some assets etc. After which is much easier to give more direct advice on how to prevent/minimise that time.

1 Like

Oh I think I got it but then it leads to an other problem :frowning:

To switch from the intro_scene to the main_scene I use the position of an entity.
When my object reach a certain position I go to the next scene. This is how I do it :


GotoMainscene.prototype.update = function(dt) {

    var entityPos = this.entity.getPosition();

    console.log(entityPos);

    if(entityPos.x>-2){

        this.app.scenes.changeScene("main");

    }

};

The problem is that the update loop seems to repeat this.app.scenes.changeScene(“main”); many time.
Is there a better way to achieve it ?

Sorry I will open a new topic because this is a different issue.