My animated 2d character is jumping too high
Hi I have a 2d character jumping multiple times and too high. How can I make it jump only once?
Here's the script:
public float speedforce = 5.0f;
public Vector2 jumpVector;
public bool isGrounded;
public Transform grounder;
public float radius;
public LayerMask Ground;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
isGrounded = Physics2D.OverlapCircle (grounder.transform.position, radius, Ground);
if(Input.GetKey(KeyCode.UpArrow) && isGrounded == false) {
GetComponent<Rigidbody2D>().AddForce (jumpVector, ForceMode2D.Force);
}
}
}
Any help would be appreciated
Answer by sadowlight123 · Aug 25, 2016 at 05:03 PM
hello , did you try messing up with the gravity? try making the gravity in the rigid body a bit higher by the way what do you mean by jumping multiple times?
Answer by Mesut000 · Aug 25, 2016 at 05:39 PM
@sadowlight123 I mean if you keep pressing the jump button it will jump very high. How do I add the gravity by the way?
on your player , you added a rigid body , search for gravity
Your answer
Follow this Question
Related Questions
jumping for different characters? 0 Answers
Character Jumping Too Fast 0 Answers
How to have precise jumping 0 Answers
Problems with jumping in another scene 0 Answers
Character stuck in ground/can't get character to jump 1 Answer