Godot Version
4.7
Question
Hi! I am having a weird bug in my prototype which I do not understand and don’t know how to debug.
(As I just created the forum account, I’m unfortunately not allowed to upload a small video of the bug. I also posted my case here on the Godot discord in case someone wants to check Discord )
Game setup
- Local multiplayer game, Splitscreen
SubViewportPlayer1is the main window with theLevelscene as child, its world2d is propagated toSubViewportPlayer2- Each
Playerhas a Camera as child
Spell Casting architecture
- A
UIComponenthandles input and calls acastfunction on thePlayer. The spell scene will be instantiated from aSpellResourceand added to the scene tree as a child ofSpells(so technically far away from Player 2) - After a timer runout, the spell scene will queue_free() itself
Problem
- Whenever Player 2 casts a spell, and Player 1 casts a spell immediately after, The sprite of Player 2 will dissapear once their spell scene will
queue_free()
What I checked
- I think this problem is related to the
queue_free()because once I remove this line from the spell script, the problem disappears - The node is still in the tree and set as visible, the physics process is still working
- Debugger monitor shows the object in Physics2D and in “Objects Drawn”.
- I see no Error messages at all in the debugger
Once I cast another spell from either Player 1 or 2, Player 2 will re-appear. This bug is even dissappearing after a certain amount of casts. I am completely clueless, so I am grateful for any kind of direction on this problem.
Thanks in advance!




