Hello, I'm currently struggling making a Vampire Survivor clone.
I'm now stuck on the ability/spell popup system
I have a Player with a level_up function that will popup a Node with an exit button and a VBoxCantainer

This is the code on my Player
var spell_amount = 3
var packed_scene = [
preload("res://Button1.tscn"),
preload("res://Button2.tscn"),
preload("res://Button3.tscn"),
preload("res://Button4.tscn"),
preload("res://Button5.tscn")
]
onready var spellmenu = get_parent().get_node("CanvasLayer/SpellMenu")
onready var vbox = get_parent().get_node("CanvasLayer/SpellMenu/VBoxContainer")
func level_up():
get_tree().paused = true
spellmenu.visible = true
for _i in range(spell_amount):
randomize()
var x = randi() % packed_scene.size()
var scene = packed_scene[x].instance()
vbox.add_child(scene)
This randomly adds 3 buttons in my VBoxContainer.
Now how do I delete and not able to instantiate that button when I click it?
I'm not sure if this the proper way to code it