godot-shooter / commit
Fix navigation on mobile.
World.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/World.gd b/World.gd index 69717cd..1c5de5c 100644 --- a/World.gd +++ b/World.gd @@ -33,7 +33,9 @@ func _input(event: InputEvent) -> void: if event.pressed && !$Player.dead: Utils.log("event position", event.position) Utils.log("to_global(event.position)", to_global(event.position)) - set_destination(to_global(event.position)) + Utils.log("player", $Player.position) + var result = event.position + $Player.position - Vector2(500, 300) + set_destination(result) func _process(_delta: float) -> void: if Input.is_action_just_pressed("click") and !$Player.dead: