"get_tree().reload_current_scene()" never gets executed
What about hiding the player immediately, and deferring the queue_free() until after the "await"?
Try commenting-out the queue_free().
so if "await" works, but I need to use queue_free()
is it bug?
Did commenting-out the queue_free() fix the problem?
Mol yes
Then the problem is that the node needs to exist for a while in order for that code to work. Try moving the queue_free() after the "await".
Mol
Yes, I understand, but this is to reload the scene after the player is destroyed. putting queue_free() after await no longer makes sense
What about hiding the player immediately, and deferring the queue_free() until after the "await"?
Mol
It works that way, thanks
😃
Jackanapes Is this from Heartbeast's 1-Bit Godot course? looks just like it and just so happens to be the exact thing I was working on when I encountered the issue. 🙂
Thanks for the suggested solution Distribute . Once I realized that's what was happening, I created a workaround by moving the 'await timer' and 'reload scene' code into a function in the level's script, then simply called that function using get_parent(). Works like a charm now.
© 2022 - 2025 — McMap. All rights reserved.