I have a character who needs to jump, but it also can change rotation a bit (lean forward/backwards) which prevents it from jumping properly. Here's my jump code:
if ((isGrounded)&& (Input.GetButtonDown("Jump"))) {
this.rigidbody.isKinematic=false;
kinematic=false;
isGrounded = false;
jumping = 3;
this.rigidbody.AddForce(new Vector3 (0,jumpForce,0));
}
↧