diff --git a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs index 52e76359..554bb072 100644 --- a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs +++ b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs @@ -113,8 +113,7 @@ public class PlayerMovement_Joystick : MonoBehaviour } // 应用移动 - if (moveDirection.magnitude > 0.1f) - { + Vector3 newPosition = rb.position + moveDirection * moveSpeed * Time.fixedDeltaTime; rb.MovePosition(newPosition); MoveState(); @@ -122,7 +121,7 @@ public class PlayerMovement_Joystick : MonoBehaviour // 使角色面朝移动方向 Quaternion toRotation = Quaternion.LookRotation(moveDirection, Vector3.up); transform.rotation = Quaternion.RotateTowards(transform.rotation, toRotation, 720 * Time.deltaTime); - } + } void HandleViewSwipe(Touch touch)