This commit is contained in:
huyulong 2024-11-19 11:18:41 +08:00
parent c9a7061fec
commit 0e36c4c6d3

View File

@ -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)