godot/instancing_starter/Main.gd

10 lines
219 B
GDScript3
Raw Normal View History

2024-03-26 09:34:15 +01: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)