diff --git a/Plunderblock/Assets/Scripts/ScriptsJan/PlayerScripts/PlayerMoveScript.cs b/Plunderblock/Assets/Scripts/ScriptsJan/PlayerScripts/PlayerMoveScript.cs index 9d8e417..3e4fadb 100644 --- a/Plunderblock/Assets/Scripts/ScriptsJan/PlayerScripts/PlayerMoveScript.cs +++ b/Plunderblock/Assets/Scripts/ScriptsJan/PlayerScripts/PlayerMoveScript.cs @@ -39,10 +39,10 @@ public class PlayerMoveScript : MonoBehaviour // Update is called once per frame void Update() { + jump(); move(); look(); lockCursor(); - jump(); } @@ -65,11 +65,12 @@ public class PlayerMoveScript : MonoBehaviour public void jump() { - if(Input.GetKeyDown(KeyCode.Space)) + if(Input.GetKey(KeyCode.Space)) { if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.down), checkForJump)) { - rb.velocity = new Vector3(rb.velocity.x, 0, rb.velocity.z); + rb.isKinematic = true; + rb.isKinematic = false; rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse); } }