Help making my 2D platformer character jump?
So I believe the problem lies in my groundchecking (something I am having problems with already!) My character walks fine on my level, however, they cannot jump and upon my leaving my level, stays floating on the same level on the y-axis (unaffected by any form of gravity).
Here is the code: http://pastebin.com/VEfwEf6m (I didn't want to paste via unity, so you can better see the syntax!)
Thank you in advance for helping me. I am a novice and would love some advice!
@RocketsRaccoons What is the problem? Like does it throw any errors, or does it just not jump?
I don't have answer for you but I've noticed that when jumping you use
this.GetComponent<Rigidbody2D>().AddForce(new Vector2(0,650.0f));
You have a "JumpForce" variable though, which essentially does nothing as far as I can see.
One thing that might be helpful is placing "Debug.Log("Jump") next to your Addforce lines to test if the program even runs through there or if it's something else that's the issue.
You said the character moves but unaffected by any means of gravity.which mean your character stays on same Y axis value even after leaving the levels.Are you sure you unchecked Is$$anonymous$$inematic on the RigidBody2D component ? If Is$$anonymous$$inematic is turned On the game object will not be affected by gravity.
Your answer
Follow this Question
Related Questions
Help with enemy AI Please! (on 2D Platformer) 0 Answers
How to make it so I can't use the jetpack/jump while slider value is 0? 0 Answers
Help with Player Jumping Script In 2D Platformer (C#) 1 Answer
Charecter keeps playing walking animation after punching 0 Answers
need help with jumping script 1 Answer