Fade transition between levels (SOLVED)

player touches exist, and it fades to black, then loads the level then the black disappears. how do i manage going about this?
i’ve tried following another post about this using this screenshot:


but it was never helpful because i’m unable to find “do ___ to the opacity of ___”

my method of transitioning between levels is like this:


all i would do is to change the scene back to my main scene and increase the variable by one

The example you are using is for a much earlier version of GDevelop and is outdated.

To get a fade effect like the tutorial :

  1. In the editor, add a tween behaviour to the Fade object.
  2. Use the following code :

You need to swap those two actions around - set the variable, then use it. Unless you’ve set the value in the project properties, that event doesn’t make sense.

Also check out the transitions painter extension :wink:

2 Likes

the code you have given me doesn’t work



Screen Shot 2022-05-03 at 1.14.44 PM

Have you got the object fade covering the whole screen?

i do have it on my scn_game, yes. but not on my other levels

In scn_game, create another layer (make sure the layer is the top one in the layers editor) and place the fade object on that. Stretched it to cover the full screen. In scn_game, add the event :

image

That should see you right.

it’s half working, but now i’m unable to switch levels? I slightly altered the code to fit what I needed, so this is what I have.


Screen Shot 2022-05-05 at 12.11.20 PM

EDIT: when i touch the sign, it just restarts to level 1
i don’t have to include “Change the global variable ‘current_level’ set to 1” because it’s already set to one, i think that would fix it not switching levels?

EDIT: correct, it does change levels now, but the fading transition doesn’t transfer over each level

EDIT:


i switched the two conditions around thinking it was the problem, i was wrong.

EDIT: i fixed the problem by simply putting the fade block covering the whole screen on each level, thank you for the help!