Questions about character movement/physics engine in multiplayer game

I created a small sandbox environment to test the character movement using jbullet. With bullet-native I did encounter some weird behaviour: forces that aren’t applied anymore after some time has passed (character seems stuck in the world)
I didn’t do any tweaking yet in this example (all default physics values) and didn’t look into jumping or setting friction (don’t slide of the slope) etc…

I see you are using forces body.applyCentralForce() to steer the character. At the moment I’m using the setLinearVelocity() method on the rigidbody to move it. I guess the result will be more ‘lifelike’ when using forces or are there any other benefits of using forces over setting the linear velocity?

In case anyone is curious: I did manage to find a way to ignore certain collisions between rigidbodies (in this case, player vs player). You can add a PhysicsCollisionGroupListener to the physicsSpace. This listener is called when a collision is about to happen. When the listener returns false, bullet will just ignore the collision!

1 Like