fuzzyworld

godot-shooter / commit

Trying to convert the mobile position to global position.

279c7477cf4928b078d15ee8ef367caf310c7e38 · Pavel Safronov · 2023-11-01 22:55:07 -0700 · parents 592bb6ef388d

Trying to convert the mobile position to global position.
 World.gd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/World.gd b/World.gd
index 50ba7c8..76b5b25 100644
--- a/World.gd
+++ b/World.gd
@@ -31,7 +31,7 @@ func add_new_enemy(should_be_visible: bool = false) -> void:
 func _input(event: InputEvent) -> void:
 	if event is InputEventScreenTouch:
 		if event.pressed && !$Player.dead:
-			set_destination(event.position)
+			set_destination(to_global(event.position))
 
 func _process(_delta: float) -> void:
 	if Input.is_action_just_pressed("click") and !$Player.dead: