In Godot, if you use get_global_mouse_position() with InputEventScreenTouch, a situation may arise where, if the first press is already active, the function continues to return the coordinates of this first press, and not subsequent touches.
I need if there is already one press on the screen (that is, it is dragged) to return the coordinates of the 2nd press
I need only get_global_mouse_position(), because event.position in func _input(event) return incorrect coordinates
Then you have to figure out how to convert event.position to a global position.
One quick search and I found this post giving some code to translate it:
get_global_mouse_position() to get the mouse position, but you used InputEventScreenTouch to get the screen touch.
Are you adapting to mobile?
If not, you should use InputEventMouseMotion and InputEventMouseButton.
If you have one, you should use InputEventScreenTouch and InputEventScreenDrag get_global_mouse_position() 获取的鼠标位置,但是你使用了InputEventScreenTouch获取屏幕触摸。
请问你在适配移动端吗?
如果没有的话,你应该使用InputEventMouseMotion和InputEventMouseButton。
如果有的话,你应该使用InputEventScreenTouch和InputEventScreenDrag