@Override public void update(float tpf) { if (forward ^ backward) { // float yCoord = charControl.getRigidBody().getLinearVelocity().getY(); Vector3f charLocation = charControl.getPhysicsLocation(); Vector3f walkDir = charLocation .subtract(app.getCamera().getLocation().clone().setY(charLocation.getY())) .normalizeLocal(); if (backward) { walkDir.negateLocal(); } charControl.setWalkDirection(walkDir); charControl.setMove(true); } else { charControl.setMove(false); } if (jump) { charControl.setJump(); jump = false; } Vector3f camdir = app.getCamera().getDirection().clone(); Quaternion newRot = new Quaternion(); newRot.lookAt(camdir.setY(0), Vector3f.UNIT_Y); charControl.setRotationInUpdate(newRot); }