@DarkLeksis said:
1. I've set velocity as a Vector2D
2. 'end_jmp' is the bool that verifie the released of the jump button.
3. 'cumul_jmp' and 'cumul _dir' are int that represent speed acquired
if end_jmp: #end_jmp confirme la vel.x et vel
velocity.y = cumul_jmp
velocity.x += cumul_dir*15
this part is in a function called just before my move_and_slide() method:
velocity = move_and_slide(velocity, Vector2.UP)
Hmm, maybe try setting the X velocity once (instead of +=
) and see if that fixes it? It could be that by adding the velocity, it's making it where the X velocity is significantly larger than the Y and therefore there is more movement on the X axis than the Y initially.
That said though, I don't see anything right off in the code snippet that would cause an issue per say, so I'm not totally sure. One thing you could try is adding print statement to check what the velocity is after pressing and/or while jumping to see if something is happening with the velocity that is causing the issue.