Hello, I’m new to this community as well as gamedev in general.
I want to ask for help with fixing my code because it doesn’t work.
I searched this Gdev forum as well as Google and YouTube to understand how tweening works but I’m still a little confused.
I want to do this:
When score is bigger or equal to 2030,
Black screen fades in (should take around 2 seconds)
Full opacity of black screen → Transitions into my game over screen (= scene named “LearnMoreEnd”)
I’m planning to use my tween-behavior sprite “TweenBlackScreen” as the black screen that fades on, but the black screen doesn’t appear on screen at all please tell me which parts to fix or delete!
This is my previous old versions of the code, which I just Toggle Disabled. They’re placed in two separate places (like not attached right beneath. But I don’t think that really matters…)
first part:
General rule
Tweens require trigger once to play
Or else it is like you have animation with 5 frames
And you want to play it when score is above 2030
It won’t play cause it will get stack on first frame
Cause that is what is your telling your game to do
Go to youtube launch any music video and for example hold 3
That is what you are doing without trigger once
If you add trigger once to it
It will play then properly
Also do not check if score or any other variable is equal to some value
I mean in rare cases you want
BUT in most cases you want to check if it is higher or lower than
Because imagine this
You want to do something if score is equal to 100
What if from lets say 97 i jump with score to 102?
Score will never be at 100
IF you would check if score is equal or above 100 then it would trigger whatever action you made for it
Hi! Thank you so much for replying.
I moved up the event of “TweenBlackScreen opacity to 0” to the beginning of the scene. Then, I added Trigger Once to the tweening actions, but it still doesn’t seem to work The black screen still doesn’t appear.