Basic Recoil

This commit is contained in:
juliuse98
2021-11-07 16:29:21 +01:00
parent 360ceb55f3
commit 352e22225f
6 changed files with 186 additions and 50 deletions

View File

@@ -102,7 +102,7 @@ public class PlayerController : NetworkBehaviour
if (Input.GetAxisRaw("Sprint") > 0 && isGrounded)
{
Debug.Log("Sprint");
//Debug.Log("Sprint");
movementSpeed = sprintSpeed;
isSprinting = true;
}
@@ -115,11 +115,11 @@ public class PlayerController : NetworkBehaviour
//Grounded
if (velocityY < 0)
{
velocityY += gravity * Time.deltaTime;
velocityY += gravity * 0.9f * Time.deltaTime;
}
else
{
velocityY += gravity * 1.0f * Time.deltaTime;
velocityY += gravity* Time.deltaTime;
}
if (isGrounded && velocityY < 0)
velocityY = 0.0f;