【发布时间】:2018-11-20 08:01:50
【问题描述】:
private void Update()
{
yaw += horizontalSensitivity * Input.GetAxisRaw("Mouse X");
pitch -= verticalSensitivity * Input.GetAxisRaw("Mouse Y") ;
if (pitch < -pitchCap) { pitch = -1 * pitchCap; }
if (pitch > pitchCap) { pitch = pitchCap; }
transform.rotation = Quaternion.Euler(pitch, yaw, 0.0f);
}
这是我在项目中用于更新相机旋转的代码。这按预期工作,但我注意到延迟特别小。当我移动鼠标时,我可以感觉相机旋转有点滞后。
在其他更大的游戏中,我可以感觉到我的鼠标移动迅速影响了我的相机旋转——一切都感觉非常灵敏。但是,有了这个设置,我不能说我有同样的感觉。有一些输入延迟。
如何减少这种延迟并生成响应更快的鼠标移动脚本?
【问题讨论】:
-
您是否尝试使用鼠标存档 FPS 效果?
-
哦,我忘了说。是的,我是。
标签: c# unity3d input camera lag