Problem with Jumping and Collision-Detecting

Hi,



I'm trying to create a small game, but i got a (hopefully) small problem with Collision-detecting and jumping.



Right now i'm trying to make the player jump.

So i attached a Controller to the Player and update the y-Position of the Player:


setYSpeed(getYSpeed() - GlobalSettings.WORLDACCELERATION);
player.getLocalTranslation().addLocal(0, ySpeed*tpf, 0);


When the player jumps i set the ySpeed to a positive value and everytime it updates i reduce the ySpeed and if the player hits the ground i just set the ySpeed to 0.

It work's pretty good, but the problem is, that i have a class PlayerAction where i react to the input of the User and move the player. I also do some Collision-Detecting in PlayerActions but to do that i have to call player.updateWorldData(evt.getTime());, because otherwise it would detect the collision too late and the player would get stuck into a wall:

public void performAction(InputActionEvent evt) {
      move();

      
      player.updateWorldData(evt.getTime());
         
      boolean hasCollision = false;
      
      ...
      
      
      if(hasCollision) {
         player.getLocalTranslation().set(lastValidPos);
      }else{
         lastValidPos.set(
               player.getLocalTranslation());
      }
    }



But now, if i move the player while he is in the air and he moves, he falls down much faster. If i remove updateWorldData(..); the player get stuck in the walls, but the jumping works correctly.

Can you help me? Do you know why the player is falling down faster as soon as i add updateWorldData();?

Dennis