Skip to content

How do I delete phantomcamera host for next scene? #423

Discussion options

You must be logged in to vote

The issue you're encountering is due to freeing Scene1 using queue_free() and instantiating Scene2 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 instantiating Scene2 before Scene1 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 generally queue_free() is safer to use.

So an alternative solution would be to just wait until Scene1 has been removed before instantiating Scene2. 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 …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mak448a
Comment options

@mak448a
Comment options

@ramokz
Comment options

Answer selected by mak448a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants