brackeys-12/main.gd

10 lines
312 B
GDScript3
Raw Normal View History

2024-09-08 20:49:37 +00:00
extends Node2D
var test_building_scene: PackedScene = preload("res://Test_Building.tscn")
func _process(_delta):
if Input.is_action_just_pressed("lclick"):
var test_building: Sprite2D = test_building_scene.instantiate()
test_building.position = get_global_mouse_position()
$".".add_child(test_building)