How do I delete phantomcamera host for next scene? #423
Answered
by
ramokz
mak448a
asked this question in
Question / Help Wanted
-
After I called queue_free() on a sub-scene, I fade in a new level. Please help! |
Beta Was this translation helpful? Give feedback.
Answered by
ramokz
Dec 7, 2024
Replies: 1 comment 3 replies
-
Would you be able to share either a small sample project, ideally with as little in it as possible, where that condition occurs? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue you're encountering is due to freeing
Scene1
usingqueue_free()
and instantiatingScene2
within the same method.Basically,
queue_free()
only removes that node from the scene after the process has finished its tick/frame, meaning you're instantiatingScene2
beforeScene1
has been freed.One way would be to use
free()
instead as that will not wait until the end of the tick free the node, but generallyqueue_free()
is safer to use.So an alternative solution would be to just wait until
Scene1
has been removed before instantiatingScene2
. Have added some sample code below that does that; in addition to simplifying the script a bit:# Input should generally be done using either the …