Player flying into oblivion.
This is the second game im making and when i start the player just flies straight up into space. i know it's something with the jump but i dont know what. here's a sample of the code i wrote.
void Update() { if (grounded && Input.GetKeyDown(KeyCode.Space)); { anim.SetBool ("Ground", false); GetComponent().AddForce(new Vector2 (0, jumpForce)); } }
Thank you in advance
Answer by OncaLupe · Nov 30, 2015 at 12:52 AM
Please format code by highlighting and using the '101010' button.
However even without being formatted, I can see there is a semicolon after the if() statement, which ends the if block and the next lines are run.
Answer by Wolfshadow · Nov 30, 2015 at 02:21 AM
The mass is probably really low, so you jump with a lot of force.
Your answer
Follow this Question
Related Questions
2D game jumping stopped working when I added lighting 0 Answers
Jumping disables my horizontal movement. 0 Answers
Jump not working 0 Answers