extends Button


@export var draggable: Draggable

func _on_button_down() -> void:
	var scene = draggable.scene_to_spawn.instantiate()
	if scene is DraggableObject:
		scene.dragged = true
		scene.mouse_in = true
	get_tree().current_scene.add_child(scene)
	var camera = get_viewport().get_camera_3d()
	scene.global_position = camera.project_position(get_global_mouse_position(),1.8)
