![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | cvetirodrigez |
I want to get the position of touch on mobile phone then move bullet there after each frame. The bullet isn’t moving much because I’m not increasing the position from process function
the bullet is area2d
func _input(event):
if event is InputEventScreenTouch:
var posOfTouch = event.position
var direction = (posOfTouch - get_global_position()).normalized()
set_global_position(direction * speed)
So how should I make it if those vars are not global?