How do I fix physicCharacters jump lag? – Video demonstration included

http://www.youtube.com/watch?v=Ag9Ugiyw8MA


In this video I first show first how my character is created.

Almoste the same as in the example given on this site.

Then I show that when my character jump, it will reach its top point, the teleport a bit down, then fall down.

This may not be very noticable in the video, but in the game it is more than obvious

I have no clue whats causing this, but as you see in the end, I jump from a ledge and end up on the ground by the teleport-jjump-glitch.

I do nothing else than player.jump(); to make it jump. I change no position, rotation or any other variable at same time.

So could you help me fix this?

change the step height, the second constructor parameter.

Thanks alot :smiley:



When I change it, the stepheight the problem gets fixed, but then I cant walk onto the sidewalk.

Before I could go over the sidewalk but now my character cant move past it without jumping…

How would I fix that?



Also, I made all models and almoste all textures myself, what do you think of my game so far? :stuck_out_tongue:

I cat watch it because you used copyrighted music. You can choose from a selection of music that youtube provides where you don’t get any copyright issues because google has taken care of that for you or the music is freely usable.

Doh!

I listend to eminem in while recording :stuck_out_tongue:

Ohwell… So there is no variable to set to enable the character to walk over obstacles that are 90 degrees from the vertical floor? Like a sidewalk or something small, so that when u hit the sidewalk edge, your character gets moved to the top of the sidewalk and you can keep walking…



Would make it alot easier to make stairs then :slight_smile:

Addez said:
I listend to eminem in while recording :P

Lol

You can try and fiddle with the stepHeight some more or just make the walkDirection point upwards too when you want to get over a step.

I dont know much about physics but maybe make the character jump automatically when he collides with walls to go over obstacles.

Found the solution:

Setting the maxSlope on the player or zombie to 180 degrees (pi in radians) will fix it.

so body.setMaxSlope((float)(Math.PI)); would do the job.



Backside is that then it can climb almoste any hill nomather how steep.

normen said:
I cat watch it because you used copyrighted music. You can choose from a selection of music that youtube provides where you don't get any copyright issues because google has taken care of that for you or the music is freely usable.

Addez said:
Doh!
I listend to eminem in while recording :P...

normen said:
Addez said: I listend to eminem in while recording :P...
Lol


MUaaaHAUHAUhauhauha. It was hilarious :D. Eminem is hilarious.