Rigidbody Stop and jump
Hello
I'm trying to make a character jump but every time I do it, the player stops moving and jump on the spot where he is.
I use this to move if (IsGrounded == true) { translation = Input.GetAxis("Vertical") Speed; straffe = Input.GetAxis("Horizontal") SideSpeed;
translation *= Time.deltaTime;
transform.Translate(straffe, 0, translation);
}
and this to jump (I tried different version, always the same result.
if (Input.GetKeyDown(KeyCode.Space) && (CrouchMode == false) && (IsGrounded == true))
{
//rb.AddForce(transform.up * JumpForce, ForceMode.Impulse);
//rb.AddForce(new Vector3(0, JumpForce, 0), ForceMode.Impulse);
// rb.AddForce(new Vector3(ActualSpeed, JumpForce, ActualSideSpeed), ForceMode.Impulse);
}
Any ideas please ?
Comment
Your answer
Follow this Question
Related Questions
C# keep previous velocity while jumping, previous solutions not working 0 Answers
How to prevent an object from jumping when moving on downslopes? 1 Answer
Unity 5: AddForce Increases power when already being pushed towards a collider. How to make stop? 1 Answer
make rigidbody jump and maintain velocity 1 Answer
How i make a ball jump where i point with my mouse?[3D] 0 Answers