mb fixed CharacterController; FpsCount

This commit is contained in:
DerTyp187
2021-10-13 08:50:54 +02:00
parent 475110316b
commit 5e15b47d35
4 changed files with 28 additions and 23 deletions

View File

@@ -72,6 +72,10 @@ public class PlayerController : MonoBehaviour
}
private void UpdateMovement()
{
//Grounded
velocityY += gravity * Time.deltaTime;
if (isGrounded && velocityY < 0)
velocityY = 0.0f;
//Jump
if (Input.GetButtonDown("Jump") && isGrounded)
@@ -80,14 +84,6 @@ public class PlayerController : MonoBehaviour
velocityY += Mathf.Sqrt(jumpHeight * -2f * gravity);
}
//Grounded
if (isGrounded)
velocityY = 0.0f;
velocityY += gravity * Time.deltaTime;
Vector2 targetDir = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")); //Get Inputs
targetDir.Normalize(); //Damit schr<68>g laufen nicht schneller ist