Hey, I’m making my own 2.5d platformer and I’m making the character controller currently. The jumping for my character is currently a bit glitchy. Sometimes it won’t jump, other times you can double jump (you shouldn’t be able to double jump!). Here is my code: ` isGrounded = doGroundCheck();
It used Physics.CheckSphere() at the position of his feet to determine if there is ground there or not. The ground also has a ground layer mask to determine if it is ground or not.
I think it’s possible the problem is in:
rigidBody.velocity = Vector2.up * jumpForce;
If you have any other codes that change the velocity it might kill your jump. What I mean is this code it telling the player to move up, but then is overridden when you move left or right.
Maybe a solution would be:
rigidBody.velocity = new Vector2( rigidBody.velocity.x , jumpForce );
And also adjust your other codes that move the player.
Thank you, I did change it buuut… It didn’t work. I can still double jump sometimes and I can’t Jump at all other times. I tried using debugs but everything happens to fast in a Jump and I don’t know how to reproduce the bug exactly so I just don’t know when I can double Jump or what I did to make it not work for Jumping at all. Am I able to send the project somehow or maybe you have another solution?