How to stop specific objects when game is over


I am a new to using Gdevelop, and I am trying to create a game about spaceships. In the game over scene of the game, when the spaceship hit the falling obstacles, the spaceship and the obstacles should stop moving and spawning. I tried using the Time scale, but I only want the spaceship and the obstacles to stop moving, but not the stars. The stars should continue spawning and moving. I need help to fix it, thanks. :slight_smile:

If you are using GD5 or the latest version of GD4 then you can use the action “Layer time scale” (located at “Layers and cameras >> Time”), just put the stars in another layer, then you’ll be able to stop the ship setting its layer time scale = 0 :slight_smile:

A more general solution is to put all the events you want to be able to start and stop as sub-events of a master event that tests the value of a scene variable e.g. gameover . That master event would have the condition that variable gameover=0. As soon as the spaceship crashes, set gameover to be 1 and then none of those sub-events will run.