Isn’t that what I was doing before?
So you’ve replaced the second action in that snip with the following?
Change the global variable current_level_time: set to TimerElapsedTime(“TimeFromStart”)
I’d also suggest adding a trigger once to that event.
Yes, but the display is still moving. That’s why I posted that larger screen grab. I thought maybe something there would explain why it’s doing it.
I just added the “trigger once” as well, but it didn’t change anything. The timer display keeps moving forward.
So, that points to the variable you are using to display the time being set somewhere else.
What is the variable that’s used to dislpay the time?
What other event actions set the value of that variable?
What is the variable being set to?
Why is there another action that sets the variable?
There should only be one spot, and that in the event where MainChar collides with Finish for the first time.
That variable is to keep track of the “best time”.
I’ll try creating a new timer that is separate and attach that to the display to see if it works with pausing the timer. Then I’ll come back and let you know.
It took me a while but I finally figured out what was sending the time information to that text. It’s the following action:
Is this the reason the pause timer action isn’t working?
Yes. TimeFromStart() will give you the time since the scene started. And every time/frame that action is run, the time will be updated.
If your pause timer event is in the same script as the above snip, then you can use this event action :
Change the text of Timer: set to "Time : " + ToString( TimerElapsedTime(“TimeFromStart”))
I tried that just now, but it just made the timer vanish.
Can you share your project (here or PM)? I think it’ll get solved more quickly. I suspect there are other areas that are affecting the timer display.
Thank you! I just PM’d you a link to the project.
OP sent project via PM, and used a lot of external events (a good thing, as it made understanding what was happening a lot simpler
). I’ve suggested a finite state machine type technique to control which events are run during play, and which are run when the congrats layer is displayed.
There were also a number of events that were updating the Timer text to TimeFromStart(), which were causing the issue.
Yet again, MrMen to the rescue! He got it working for me.
Thanks again!
I’m trying to wrap my head around (hopefully all of) the things that will need to be changed to bring the “congrats” scene elements into each level.
I would recommend looking up some tutorials on how to use external layouts to get a better understanding of the whole concept.
Basically the congrats screen is designed as an external layout and the objects in it are made global objects. Create a layer in each scene that only has the objects that you want on the congrats screen. At the beginning of the scene have that layer be hidden.
Then whatever method you use to trigger the end of the level, also have that trigger that layer becoming visible,
