【问题标题】:godot character movement on iosios上的godot角色移动
【发布时间】: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 我必须触摸按钮才能移动角色

【问题讨论】:

    标签: ios godot


    【解决方案1】:

    默认情况下,iOS 上的触摸有 150 毫秒的延迟(但在 Android 上没有)。这是由操作系统出于各种原因强加的,但您可以decrease this value in the project settings (input_devices/pointing/ios/touch_delay) 并再次将项目导出到 iOS。

    更多解释可以在this GitHub issue找到。

    【讨论】:

      猜你喜欢
      • 2022-08-03
      • 1970-01-01
      • 1970-01-01
      • 2013-11-16
      • 1970-01-01
      • 1970-01-01
      • 2021-10-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多