so i’m trying to get my camera to fade to black, then reset the scene WITHOUT going back to the scene first. how do i instead of this flickering from black back to the scene, make it so it fades to black, restarts the scene & THEN fades back into the game? for some reason, this does a thing where it fades to black, waits a second or 2, goes to the scene, then runs the scene like normal after 2 seconds of waiting?
// `Shake` the Camera to show `death`
__camera.shake ( 100, 0.05 );
// `Fade` the Camera out with a 250 millisecond delay
__camera.fade ( 250, 0, 0, 0, false, ( __camera, __progress ) => {
if ( __progress > 0.999 ) {
__scene.restart ( );
}
} );
I make this effect by using a black sprite over the top of scene. And so I chance its alpha, going from 0 ato 1, ou from 1 to 0, depends of what I want, if make black or make clear.
From the code you’ve shown, I don’t see where a 1 or 2 second delay could be coming from. Add some logging. You need to figure out what the scene is actually doing during that time.