forked from Wireline-Studios/JourneyProject
w
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user