Godot Version 4.3
Question
Hello everybody!
I have goal to get correct result of look_at(event.position)
I use Camera2D and I already make detection and it works correctly with this code:
func _input(event):
if event is InputEventScreenTouch and !event.is_pressed():
look_at(event.position-get_viewport_rect().size/2 + camera.global_position)
but if I try to use drag potion, look_at works incorrectly.
I tried:
camera.global_position - player.global_position
player.position - camera.global_position
camera.global_position - player.position
camera.position - player.position
And it still didn’t give me result that I want
May be someone can say me how ca I get correct result?