This commit is contained in:
MindfulMinun committed 2022-02-21 14:27:59 -06:00
1 parent 6e9f890604
commit f9c839fdf2
11 files changed
+1097 -21

No files matched your search

+7 -8
View File
@@ -13,26 +13,25 @@ public class PlayerMovement : MonoBehaviour
// Update is called once per frame
void Update() {
// Horizontal value is for the animation state machine. No code required, wow!
animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
if (Input.GetButtonDown("Jump"))
{
if (Input.GetButtonDown("Jump")) {
jump = true;
}
if (Input.GetKeyDown(KeyCode.LeftShift))
{
if (Input.GetKeyDown(KeyCode.LeftShift)) {
crouch = true;
} else if (Input.GetKeyUp(KeyCode.LeftShift))
{
} else if (Input.GetKeyUp(KeyCode.LeftShift)) {
crouch = false;
}
}
void FixedUpdate()
{
controller.Move(horizontalMove *Time.fixedDeltaTime, crouch, jump);
controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump);
jump = false;
}
}