Python command for restarting scene

Hello. Im trying to write a program in Python in Cospaces and cant seem to find a command for restarting the scene. I found the one for quitting the game and wondered if there is one for restarting it. Checked the documentation and didn`t find it listed anywhere.

If there is code to restart a scene, I am sure someone will post it. Until then, maybe you could load a blank scene, then immediately send the user back to the original one? It might work…

Yes, that could be a solution, thanks!

Hi @irinabacal,
It’s a great question, because it seems like python “refuses to go back” to the same scene.
I don’t know what exactly your game looks like, but maybe these functions created by @Jaewoo and presented in FQW-ACS can be useful too.

camera_position = camera.transform.position
camera_rotation = camera.transform.rotation

def on_camera_collision(other:BaseItem):
if other == floor:

def over_message():
title=“game over”,
text=“If you hit the floor you die. Restart game.”,

def restart_game():
camera.transform.position = camera_position
camera.transform.rotation = camera_rotation

Wish your game comes out great.

1 Like

Hi. I have a game where the camera is fixed in the air, so basically I just need to restart the game when 2 characters collide, thats why I dont think this code resolves the problem, but I could make use of it in other projects,like a parkour. Thank you very much for the input.