HungryProton / scatter

Godot engine addon to randomly fill an area with props or other scenes
MIT License
2.08k stars 94 forks source link

Game crashes if scatter gets removed while rebuilding #187

Closed OlliO6 closed 5 months ago

OlliO6 commented 7 months ago

Hey, while I was working on my game it froze and crashed without error message. It happended everytime when I immediately skipped a cutscene (wich used proton). After scratching my head, I figured out that its not happening when I disable force_rebuild_on_load and that got me testing a little.

I figured out that the game freezes when a scatter is removed from the tree (with queue_free() or remove_child()) while rebuilding with full_rebuild(). It also happens when calling full_rebuild() while rebuilding.

For my game, I should be fine with just disabling force_rebuild_on_load by default.

I hope that helped and I love this addon anyways :)

Example: proton_crash.zip (press 'space' to rebuild and 'esc' to remove) Edit: Godot 4.2.1, win 11

yoont4 commented 6 months ago

Just wanted to say I run into the same issue. Really like the plugin, just wish this scenario worked as I cannot disable that option for my setup.

HungryProton commented 5 months ago

191 addresses part of the issue. The bug will still happen if you have a relax modifier using compute shader running, but I'm not sure why this happens. Any node should be able to manipulate a render device even when outside the scene tree, so I'm still looking into it.

Turns out it wasn't related to the relax modifier in the end. Fix is coming.

HungryProton commented 5 months ago

Should be fixed, don't hesitate to re-open the issue if you still encounter this problem.

yoont4 commented 5 months ago

That appears to have fixed it, thank you so much!