If you're instantiating your CharacterControl
without parameter, the character
member in the PhysicsCharacter
class won't be initialized.
The full trace would be:
=> simpleUpdate()
=> playerControl.setWalkDirection()
=> character.setWalkDirection(Converter.convert(walkDirection, tempVec));
=> NullPointerException on character object
This is the issue, when you're calling the method playerControl.setWalkDirection
.
So you have to use another constructor like CharacterControl(CollisionShape shape, float stepHeight)
.
CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
playerControl = new CharacterControl(capsuleShape, 0.5f);
For parameter values and other stuff see: