hehe forgor to push double jump memes

This commit is contained in:
Zoe J committed 2022-02-22 00:17:57 -06:00
1 parent 70cbc01c25
commit 4c7900d435
5 files changed
+33 -22

No files matched your search

+6
View File
@@ -21,6 +21,7 @@ public class Movement : MonoBehaviour
private bool m_FacingRight = true; // For determining which way the player is currently facing.
private Vector3 m_Velocity = Vector3.zero;
public static bool pause = false;
private bool dj = false;
[Header("Events")]
[Space]
@@ -135,6 +136,11 @@ public class Movement : MonoBehaviour
// Add a vertical force to the player.
m_Grounded = false;
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
dj = false;
}else if (jump && dj == false){
m_Grounded = false;
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
dj = true;
}
}
}
+2 -2
View File
@@ -5,7 +5,7 @@ using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public Movement controller;
public Animator animator;
//public Animator animator;
public float runSpeed = 40f;
float horizontalMove = 0f;
bool jump = false;
@@ -14,7 +14,7 @@ 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"));
//animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;