I'm using a
btKinematicCharacterController with a capsule shape for my player character. Everything works smoothly, however when I try to implement jumping by adding an upwards force, the result is very inconsistent:
https://youtu.be/e1MsiUosjDk
Sometimes the character is jumping higher, sometimes lower, for seemingly no reason.
The force is just being added as linear velocity:
Code: Select all
PhysKinematicCharacterController *c = getKinematicCharacterController();
c->setLinearVelocity(c->getLinearVelocity() +btVector3(0.0,5.0,0.0));
It only seems to happen when the character is standing on something, so it might have something to do with the ground collision?
Does anyone have an idea what I can do about this?