[SOLVED] Character Control Shuddering

Hey all, i’m using a characterControl on some JME Terrain, using the standard walking character stuff from the tutorial, as the dude moves along, he rotates fine, but when i am walking… he shudders (as you can see in the vid) the animation and stuff is fine without the motion… but it looks like the physics location is being updated, then set back to the old, then updated really quick… is this an issue in the library or something i am doing wrong?



Link to the video

http://www.youtube.com/watch?v=PxYa5MgUI1s&feature=youtu.be



Pertainent code?



[java] //handle the physics of the player

Vector3f playerDir = playerControl.getViewDirection().clone().multLocal(forwardSpeed);

walkDirection.set(0, 0, 0);

if (left) { playerControl.setViewDirection(turnSideWays(true, tpf)); }

if (right) { playerControl.setViewDirection(turnSideWays(false, tpf)); }

if (up) { walkDirection.addLocal(playerDir); }

if (down) { walkDirection.addLocal(playerDir.negate()); }



getPlayerControl().setWalkDirection(walkDirection);



//if we are going forward or backward set the walk animation

if((up || down) && !channel.getAnimationName().equals(“Slash”))

{

playerWalk();

}

else if(channel.getAnimationName().equals(“Walk”))

{

playerStand();

}[/java]

:frowning:

the problem is propably becouse of your code. your update loop is not executing like characterControl do it(i mean characterControl is executing somehow each 2 or more frames, you should not change walkDirection each frame, change it only, if needed - this is what i think).



try first to add characterControl with walkDirection in simpleInit(nothing in update loop) and see a diffrence, then you will know what are you doing

wrong.



there is always possibility that you ugly rollback your animation(end of move animation is not the same as start of it), and it look like this.

1 Like

Oddly enough, when i comment out the update code, and just set it walking in one direction in the init, the model still shudders… if i play the animation without the walking direction, no problems…



Actually the shuddering occurs when the model begins falling from the sky (without any walking direction)

It looks like this problem has more to do with the chase camera then actually the physics control… if i set it to fly camera, and watch the model move, there doesn’t seem to be any of the shuddering effects…

i watched video again. terrain do not “shuddering” so it cant be camera / chase camera.



only character is “shuddering”. if you need a perfect help from me, you need to prepare a testcase then. I cannot guess :wink:

Well i redid how i did the chase camera and it works now (i think i might have been doing it a JME2 way?!)… Thanks for the help, some times just running around your code trying to explain your problem is enough to find the solution!