首页 > 解决方案 > GODOT GLES2 的刚体physics_process 基类调用

问题描述

在 godot 中,区域对象可以在碰撞形状中覆盖重力。

但是,当 _physics_process(delta) 中有任何东西改变了刚体的位置或方向时,区域重力将不再起作用。

如果设置为 GLES3,则可以调用 .physics_process(delta) 以使区域重力再次起作用,但是如果设置为 GLES2,它将显示 .physics_process(delta) 或 ._physics_process(delta) 的不存在函数

func _physics_process(delta):
    .physics_process(delta)   # notice this will make it work in GLES3
#   doing anything setting orientation here, the area gravity will disappear
#   self.rotate(Vector3.FORWARD, deg2rad(5))  # removing this and the area gravity will work
    pass

有没有人遇到过类似的问题,以及 GLES2 中的基类调用的等价物是什么?因为在 Android 上使用 GLES3 会太慢。还是您只是使用进入和退出刚体本身对重力行为进行硬编码。

谢谢。

标签: areagodotgravity

解决方案


推荐阅读