This commit is contained in:
IsaacWarhol
2026-02-02 15:25:09 -08:00
parent 65001c0ecb
commit 4253e33ed4
11 changed files with 52 additions and 26 deletions

View File

@@ -120,14 +120,13 @@ public class PlayerMovement : MonoBehaviour
moveInput = walkAction.ReadValue<Vector2>();
if (runAction.WasPressedThisFrame() && moveAnimationInputY == 1 && !running)
if (runAction.WasPressedThisFrame() && !running)
{
running = true;
}
else if (runAction.WasPressedThisFrame() && moveAnimationInputY == 2 && running)
else if (runAction.WasPressedThisFrame() && running)
{
running = false;
moveAnimationInputY = 1;
}
playerCam.lookInput = lookAction.ReadValue<Vector2>();
@@ -285,18 +284,18 @@ public class PlayerMovement : MonoBehaviour
//Debug.Log(controller.isGrounded);
if (canWalk /*&& !running*/)
if (canWalk && !running)
{
Vector3 move = new Vector3(moveInput.x * speed, 0, moveInput.y * speed);
Vector3 move2 = transform.TransformDirection(move);
controller.Move(move2 * Time.deltaTime);
}
//else if (canWalk && running)
//{
// Vector3 move = new Vector3(moveInput.x * speed, 0, moveInput.y * runSpeed);
// Vector3 move2 = transform.TransformDirection(move);
// controller.Move(move2 * Time.deltaTime);
//}
else if (canWalk && running)
{
Vector3 move = new Vector3(moveInput.x * speed, 0, moveInput.y * runSpeed);
Vector3 move2 = transform.TransformDirection(move);
controller.Move(move2 * Time.deltaTime);
}
controller.Move(velocity * Time.deltaTime);
}
private void MyInput()