Godot 4.5
Im somewhat mystified.
@export var item = load("res://scenes/item.tscn")
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT && event.is_pressed():
add_item()
func add_item() -> void:
print("beep")
add_child(item.instantiate())
thats all thats happening.
this is the tree. script is on the Inventory vbox.
And i also print two beeps. So the script works, except it does it twice and creates a copy of my inventory node as a direct child of the root, where it puts the second item. I have no clue whats happening.
