godot-docs/scripts/balls.gd

10 lines
219 B
GDScript3
Raw Normal View History

2024-08-27 18:53:33 +02:00
extends Node
@export var Ball: PackedScene
func _input(event):
if event.is_action_pressed("click"):
var new_ball = Ball.instantiate()
new_ball.position = get_viewport().get_mouse_position()
add_child(new_ball)