Camera fade issue?

so I’m trying to simply fade out my scene when the character goes beyond the map limits. Problem is, it fades to black then goes back to the scene for a second before resetting the scene.

Here’s the code I’m using :

// `Fade` the Camera out with a 250 millisecond delay

cam.fade ( 250, 0, 0, 0, false, ( camera, progress ) => {
	if ( progress > 0.999 ) {
		this.__scene.restart();
	}
} );

cam.on ( Phaser.Cameras.Scene2D.Events.FADE_OUT_COMPLETE, ( ) => {
	this.__playerFallsInHole = false;
} );

Here’s a video of the issue :

Any help as always is GREATLY appreciated!

Thanks!

Someone can help?

did you already try restarting the scene in the onComplete Event?

HTH

How?

Hello?..

hello? Tired of being ignored here… :frowning:

Try to figure out what your scene is doing during that time. Add breakpoints or console logs.

sorry, was very busy lately and therefore didn’t visit the forum. Didn’t mean to ignore you.

you still working on that issue?

i meant:

cam.on ( Phaser.Cameras.Scene2D.Events.FADE_OUT_COMPLETE, ( ) => {
this.__scene.restart();
	this.__playerFallsInHole = false;
} );