Hi everyone,
Instancing Scenes
in the docs (https://docs.godotengine.org/en/latest/tutorials/scripting/nodes_and_scene_instances.html) leave me a bit paranoid with one open question, because I read a lot about Node.queue_free
and remove_child(node)
and alike. I believe I can relaxe on this one but I'd like confirmation from the experts once and for all *: )*
My case: I have prepared a simple animation-scene (a circle expanding and fading out) that is put on top of any button withing my project when pressed.
func _on_Button_gui_input(event):
if event.is_action_pressed("mousebuttonclick"):
var buttonpresscircle = preload("res://button-press-circle-scenes/ButtonPressCircle.tscn").instance()
add_child(buttonpresscircle)
This works great. Every button features that code.
I don't have to „remove“ anything after that little animation is being „called“, do I? It's not „adding up garbage“ anyhow when pressing more and more buttons over time, right? Or should I somehow „delete“ the scene again right after it's finished the animation?