# (SOLVED) Is there a way to freeze a scene?

I have a scene with a lot of moving objects and I wish the scene freezes as soon as the player fails, so he can check what he did wrong. I want to freeze all objects. My objects move by position(x/y) not by forces. Thanks!

Set layer timescale = 0
Wait what you want
Set layer timescale = 1

Thanks. I was using timescale in a linked external event. I moved it to the scene event and it worked. Many thanks!

Nope! It doesnâ€™t stop movements based on positions xy.
Is it the same if I use timescale scene or layer? I have no layer.

You can try the General Timescale Thi should take effect in your scene

Or the camera layer timescale this should take effect in the layer you want to stop

I did exactly like the tutorial shows, but the ball doesnâ€™t stop when I press esc key.

With that events you never set pasuse = 2 so never is coming back pasue to 0
You maybe need to add a timer
if Esc is pressed or the player is hurt set a timer like â€śFrezeSceneâ€ť
Then check if â€śFrezeSceneâ€ť < 1 sec
Set timescale = 0
Set pause = true
Then check if â€śFrezeSceneâ€ť > 1 sec
Set timescale = 1
Set pause = false
Delete â€śFrezeSceneâ€ť timer.

Those events do work if I assign a force to the ball. I get Pause=2 if I press esc twice so it turns into 0 and set the timescale back to 1. But Iâ€™m gonna try your sugestion.

I tried what you said, but no avail. Time scale doesnâ€™t freeze objects moving by coordinates.

Hi. If youâ€™re moving them with x=number and not a force. Then add a boolean check and make all of your move events a sub event.

Boolean gamePaused false
| Move something
| Move something else
â€¦

1 Like

Changing the coordinates directly to create a constant movement is not considered a good practice. You do not seem to have a special case where those would not work. Forces are just position changes relative to the object, e.g. go one pixel to the right, and unlike changing the position directly, it takes into account both the frame rate (your code right now adds 1 to the position every frame, but if the frame rate goes lower, e.g. from 60 to 30, then the position will be changed half as much, and therefore the object speed will be divided by 2. With forces, the object move relative to real time not to the frame rate, so regardless of the frame rate, the object will move the same distance in 1 second) and, more importantly in your case, forces take into account the time scale.

If you do not care about forces or game creation good practices nonetheless and just want to make your event work, simply multiply the number you add to the position by `TimeScale()`.

1 Like

Thanks arthuro! I tried to use force but I confess I could not manage how to make the collision works. When the ball moves 1 pixel at a time, in a certain moment both positions (ball and wall) will be the same and collision triggers, but using force the ball position is always a decimal number and positions wont match to trigger the action. But Iâ€™m trying and I will get it!

Thanks. I had already did that and it worked. But now Iâ€™m trying to use force instead of adding x.

1 Like

Got it by using ceil and floor to round positions. Thanks all.