Topic was automatically imported from the old Question2Answer platform.
Asked By
kietjay123
my game require constant update of a var with a drag gesture postion as my finger is moving on the touch sreen please help as im pretty new to programming
var point_pos = Vector2(0, 0) # Position will be here as Vector2
func _input(event):
if event is InputEventScreenDrag:
point_pos = event.position
It will works only with drags. If you want to handle single-point tap or touch, you should use InputEventScreenTouch. So you can use that event types together:
if event is InputEventScreenTouch or event is InputEventScreenDrag: