How do I make an action only activate once?

I’m trying to make a space game where you’ll need to do research to go to space.
I placed all those research stuff in a different scene.

Screenshot 2022-08-20 at 22.36.17
Main (Launch Site) scene events

Research scene events

But everytime I switch to the research scene andf back to the main (Launch Site) scene, the year and funds (money) increases.
I think it’s because everytime I switch back the scene restarts to it adds the year and funds because of how I programmed it.
I tried removing “At the beginning of the scene” but the timers just get reset the whole time.
Is there any way to fix it or a different method of building it?

If instead of changing scenes, you pause the launch site to go to research, and use the 'go to previous ’ scene command to come back to the launch, does it work?

1 Like

It works now but everytime I go back to the launch site then back to research, research gets reset. Do you know any way to fix this?

I don’t have a lot of experience with pausing scenes so I don’t know how Gdevelop handles it exactly:
Maybe when you switch to launch, instead of going to previous scene, pause research as well to go to launch?
So you just pause the scenes and switch everytime without going to previous scenes.

And otherwise you’d have to store all the research progress in global variables, because whenever you leave or stop a scene, it resets completely.

1 Like

It doesn’t work but thanks for the help

Apparently Gdevelop does not allow more than 2 items in the scene array to pause scenes.

Btw. if you don’t like Global Variables, you can also create both ‘launch’ and ‘research’ inside the same scene but on different layers.
All you need to do then is to hide / show the correct layer to change the “scene”.

I’ve also seen someone place different scenes next to each other in one scene and then simply changing camera position to change the scene:
tutorial on youtube

This is just for correction of what I said:
I recently worked a little bit with pausing scenes.

You can pause an unlimited amount of scenes. The problem is that if you start a scene that is already paused, it starts that scene as a new instance, instead of going back to the already paused scene.

So you could only make this a feature request to have a
“Pause and go back to previous scene” function.

Given that audio/music and tweens are not paused and continued correctly after pause, I’m not sure how useful the “Pause” function is at the moment.