-
Hello community I'm trying to make a player jump but the animation is having a problem, when falling instead of constanly goind down, when it reach certain point it goes instantly to the ground height. I use a player component to create the jump and implement the logic by overwriting the onUpdate method I use the following code `@Override public void onUpdate(double tpf) {
the player goes up well but the falling fails, I used the print function to see how is the workflo and got the following `player Height 4.8 ---------- player actual y 4.6750000000000025 player Height 4.8 ---------- player actual y 4.680000000000002 player Height 4.8 ---------- player actual y 4.685000000000002 player Height 4.8 ---------- player actual y 4.690000000000002 player Height 4.8 ---------- player actual y 4.695000000000002 player Height 4.8 ---------- player actual y 4.700000000000002 player Height 4.8 ---------- player actual y 4.8` So basically when it reaches the 4.700 height it goes down to 4.8 instead of translateY by 0.005 as the method states. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please disregard this, my collision handlers was wrong |
Beta Was this translation helpful? Give feedback.
-
The logic was wrong |
Beta Was this translation helpful? Give feedback.
Please disregard this, my collision handlers was wrong