[Solved] Fading a scene in and out


I’m not sure what you mean, like this? if so then its not working.

No, no, in the scene that have the INPUTS (key pressed events) make those events in the sub condition, and the reset timer should be in another event with the condition on beginning of the scene

Sorry. I think I need to see it.

Sorry I’m not on PC maybe later

Thank you. the basic script I had in that was working has decided to not work now, so need to take a break anyway.


original code

here is an example of my gameover screen:

so start with 255 opacity and let timedelta reduce it, till the point where you want to be able to press any button to skip.

or in your case, vise versa

2 Likes

Thank you. That’s is a bit more intense than what I originally had but ill give it a go and see.

I’m still struggling

I use layer effect and tweens animation.
I use also an object variable CORE_GAME_BEHAVIORS but you can replace it by a global or scene variable.
And your need attach a effect to your base layer.


If you have multiple layer you need duplicate first event for each layer and give the name of layer in parameter.

3 Likes

I’m starting to feel that this is beyond me and I need someone to take the time to go through this step by step with me.

Use a variable for opacity and do the keys react only after
the full opacity has been reached.

I’m having issues with the sprite not fading so the button push wont activate.

I use fade in and out in my projects, but never used timers or behaviors.
Just if opacity > or < 0/255 do +/- x to opacity.
It works fine to me.


I’m just not getting it.


this should work just fine.

there is no need to set the opacity to 255 at the beginning, since this is the default value, unless you changed it before.

2 Likes

That worked perfect. Thank you. I changed the delta time from +10 to +1 to get a slower fade in and delay the button press.
Thank you to all of you. Been an amazing help!

1 Like

last line should be less or equal to 0
If not, and the value is exactly 0, the sceneswitch is not triggered.

It works perfectly now. Thank you

Hey so what’s the name of the action for the Do - TimeDelta() + 1 to the opacity of Fade?
Stupid question, I know :sweat_smile:
I’ve been trying to find it for a while but couldn’t.