void Update() { if (PointerLock.GetMode() == PointerLock.Mode.FIRST_PERSON) { CheckPhysics(); CheckInput(); transform.position += velocity * Time.deltaTime; } }
void Update() { #if !UNITY_WEBGL || UNITY_EDITOR if (Input.GetKeyDown(KeyCode.Escape) && PointerLock.GetMode() == PointerLock.Mode.FIRST_PERSON) { EnableMenus(); } #endif if (PointerLock.GetMode() == PointerLock.Mode.FIRST_PERSON) { FollowMouseRotation(); } }