[Solved] Fading a scene in and out

Hi,

I’m new and am trying to make the platformer I have created a little more professional.

I’m currently looking to make my active scenes fade in when changing between scenes and fade out upon completion.

I’m unsure how to do this though.

i have a small cut scene between scenes that id also like to add a button press delay trigger too, so that the scene changes on an any button push (currently have) but have a small pause before the button can be pushed.

Any ideas?

You will have to use a black Sprite on top of everything, opacity events and the Deltatime expression.

1 Like

Sprite opacity>0
Do Sprite Opacity -4

2 Likes

I have been playing around with that as a work around than doing a transition (or even if i could do it as a transition). Thank you guys, much appreciated

I have it working, thank you. Next question, is there a way that I can set a delay trigger so that the scenes wont react to the keys until after the full opacity has been reached?

Make all your input handling event a sub event of an event with the condition value of timer load is superior to (Time that takes your fade in) and make an event at the beginning of the scene reset timer load


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.