【发布时间】:2021-06-24 15:56:44
【问题描述】:
我正在使用 godot 构建游戏。
这是我的角色移动代码
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
它在 android 上运行良好,但在 ios 上我必须长按我使用的 touchScreenButton,所以 角色移动 有没有办法像在 android 上一样在触摸上工作
我将 (input_devices/pointing/ios/touch_delay) 中的延迟降低到 0.005,但没有任何变化。我仍然必须按下按钮而不是触摸它,我使用的是触摸屏按钮,但在 ios 中我必须按下它才能使角色移动,不像 android 我必须触摸按钮才能移动角色
【问题讨论】: