global mouse pos
This commit is contained in:
@@ -7,6 +7,8 @@ extends Node
|
||||
@onready var plant_scene = preload("res://objects/Plant.tscn")
|
||||
@onready var timer: Timer = $Timer
|
||||
|
||||
@export var camera: Camera2D
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if Input.is_action_just_pressed("plant") and timer.is_stopped():
|
||||
@@ -14,5 +16,5 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
var plant = plant_scene.instantiate()
|
||||
add_child(plant)
|
||||
plant.init(chosen_type)
|
||||
plant.plant(event.position)
|
||||
plant.plant(camera.get_global_mouse_position())
|
||||
timer.start()
|
||||
|
||||
Reference in New Issue
Block a user