Since I thought it would be easier in the long run to manage horizontal acceleration in code, I’m using setLinearVelocity() each frame to move the Player, this works as expected over a horizontal surface, but when I walk over a ramp the player goes flying skyward, and when it is about to touch the ground it slows down and covers the last units through small steps.
I want to know if this is a problem with my physics configuration or if I shouldn’t use setLinearVelocity() each frame and instead use physics acceleration, or maybe I should manage vertical acceleration via code as well instead of feeding getLinearVelocity().z for the Z axis velocity.
Would using KinematicBody help?
I’m using Bullet physics.
You can find the file below for testing, if you run it you’ll see a ramp to the right where you can check the behaviour I described.
Thanks for your time.
Here is the file:
In case you don’t use Google:
Mech.blend (860.8 KB)
And the sources content:
Player.hx (2.3 KB) Input.hx (1.3 KB) Scene.hx (231 Bytes)