How can I delete the previous node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Gangster53 YT

Hello. When a new node is created in my game, I want it to remove the previous node. My game is a car game with endless maps, our car creates a new road when it comes to a certain place, but the game gets tighter every time a node is created. So I want it to delete the previous node. I couldn’t find anything online on how to do it. I will be glad if you help me.

:bust_in_silhouette: Reply From: jgodfrey

The standard way to delete a node is by calling queue_free() on a valid node reference.

See the docs for details.

And, please don’t post multiple copies of the same question.