Hello, I have made an script witch makes the player jump, but when I hit play the player goes to the orbit.... I need some help =))) Code (CSharp): private void JumpInput () { if (Input.GetKeyDown("space") && !isJumping); { isJumping = true; StartCoroutine(JumpEvent()); } } private IEnumerator JumpEvent() { charController.slopeLimit = 90.0f; float timeInAir = 0.0f; do { float jumpForce = jumpCurve.Evaluate(timeInAir); charController.Move(Vector3.up * jumpForce * jumpMultipler * Time.deltaTime); timeInAir += Time.deltaTime; yield return null; } while (!charController.isGrounded && charController.collisionFlags != CollisionFlags.Above); isJumping = false; charController.slopeLimit = 45.0f; }
A good start point is to become familiar with debugging techniques. A simple start can be made using something like Debug.Log("some Value = " + someValue.ToString());. Even better if you can install and use a debugger (Visual Studio for example can be downloaded for free). With this in mind, you may want to look at the jumpForce that is being calculated each frame. Is it generating the values you are expecting?