Open fiaKaiera opened 1 year ago
Can you reproduce this when exporting the project with debugging enabled?
No, the crash does not happen at all when exported with debugging enabled.
Doesn't happen only with tiles, a large amount of Sprite2D nodes apparently suffices for this.
Godot version
v4.0.1.stable.official [cacf49999]
System information
Windows 10 64-bit
Issue description
In an exported Release file on Godot, if a
TileMap
node has a large number of tiles present in the scene, and aCamera2D
node is present, upon callingget_tree().reload_current_scene()
, the game has a chance of crashing without any errors, which can scale by the number of tiles present in the scene.The game will not crash at all if
get_tree().reload_current_scene()
is called in debug mode. This bug is not present in Godot 3.Edit/Update: The same outcome can be achieved if the
Camera2D
node is added after the scene is reloaded. A workaround fix for this is having theCamera2D
node exist outside the current scene.The conditions for the bug:
Camera2D
node is presentTileMap
node is filled with a large number of tiles placedget_tree().reload_current_scene()
is calledExpected outcome:
get_tree().reload_current_scene()
is calledCurrent behavior:
get_tree().reload_current_scene()
is calledget_tree().reload_current_scene()
is called againThere are no errors and nothing is reported upon crashing in both the editor and on the released game with the verbose console option enabled.
Steps to reproduce
get_tree().reload_current_scene()
get_tree().reload_current_scene()
Minimal reproduction project
The provided project has a script that automatically runs
get_tree().reload_current_scene()
every 0.2 seconds, with the provided scene given to easily replicate the crash once exported.Godot4TilemapTest.zip