in player death script, it uses self.queue_free(), which i suspect is crashing the netire instance after player death, on 0 health it dose. var timer = Timer.new() timer.set_one_shot(true) timer.set_wait_time(0.1) timer.connect("timeout", self.on_death_timeout) add_child(timer) timer.start()
and in the death script theres a sequence which ends in self.queue_free()
i suspect the the tree of the player file is being removed from the instance, which in turn is making the game crash,
using a keybind to reload the scene only works before the final death animation where the self.queue_free() is run,
i think it’s just your whole scene tree nodes are wrongly positioned
the main scene shouldnt be the player scene, it should be a main node/controller or level scene that never actually got queue freed during runtime
the game crashes and stays on a frozen screen, hitting reset scene dosent work after the screen freezes, the crash makes the game a bit brighter also, might be th elight script tunring off and making eveyrhting the same brightness, theres no error code in the console, just forzen game.
Does the game close if you click the X on the game window? and if not does it close if you hit f8 or hit the stop button in the editor?
If it closes from the stop or f8 but not the X button then the game is probably stuck in an infinite loop somewhere. If you hit the Pause button instead of stop you may be able to find out where in your scripts it’s stuck in a loop.
it closes with both of the options, and pausing dosen show any occuring loops, though maybe i am missing something, health dosent have too much math, and the game resets perfectly if i die in any moment before it, if i reset in the death animation, engine time scale gets stuck in 0.05 even after reseting the scene, the death animation uses the time scalefor zooming in and slowing down, and stays like that after reloading scene with the keybind.
If it closes when you press the X button it’s most likely not frozen. probably whatever code is supposed to be triggering reloading your scene isn’t running. is it in the player’s script or another node under the player?
For the engine time scale, that wont reset when you load a scene so you’ll probably want to set it to 1 whenever you change scenes if you’re modifying it anywhere. Unless you’re already doing that?
There could be a lot of things causing problems when your player is gone, without the project for context it would be hard to guess what could be causing those issues if it’s not something obvious like the reset code being in the player’s script. Otherwise you’ll most likely have to upload your project somewhere for someone else to be able to find the issue. But I’d suggest learning how to find the issue yourself instead, since that will help you a lot in the future.
Using the various Debugging Tools and generally being able to troubleshoot your script code using breakpoints and printing messages to the log (print_debug()) are things that you can do to find out what the problem is.