Reputation: 587
am using godot to build a game .
this my character movement code
func Movement():
if Input.is_action_pressed("Right") and not Input.is_action_pressed("Left"):
velocity.x = min(velocity.x + ACCELERATION , MAX_SPEED)
flip = "Right"
if get_node("Hand").position.x < 0:
flip()
get_node("Camera2D").offset_h = 1
elif Input.is_action_pressed("Left") and not Input.is_action_pressed("Right"):
velocity.x = max(velocity.x - ACCELERATION , -MAX_SPEED)
flip = "Left"
if get_node("Hand").position.x > 0:
flip()
get_node("Camera2D").offset_h = -1
else:
velocity.x = 0
its work fine on android but on ios i have to long press the touchScreenButton that i used so the character mocve is there is a way to make work on touch like on android
i decrease the delay to 0.005 in (input_devices/pointing/ios/touch_delay) but nothing change . i still have to push the button not touch it , i used touch screen button but in ios i have to push it so the character move unlike android where i have to touch the button so the character move
Upvotes: 1
Views: 274
Reputation: 949
There is a 150 ms delay for touches on iOS by default (but not on Android). This is imposed by the OS for various reasons, but you can decrease this value in the project settings (input_devices/pointing/ios/touch_delay
) and export the project to iOS again.
More explanation can be found in this GitHub issue.
Upvotes: 3