Home | Documentation | Atomic Chat | Github

Character controller

solved

#1

I’m implementing my character controller and it works with an issue: movement is a little bumpy, I mean, when hitting a little bump character jumps a little. So I decided to use a kinematic body, I checked the option in the scene editor and changed the code to manually set the position (body.SetTransform). In this case the character’s position is not updated but the LinearVelocity is updated. I tried changing the node position but it invalidates collision detection. I read about bullet physics that you “inform” the engine of changes and assumed it is through SetTransform. Also I’m using C# as I read JavaScript and TypeScript support will be dropped in the future.
I hope I made myself clear and somebody can help me with this.


#2

Well, after trial and error I came to a solution. Changed the mass and instead of applyImpulse I’m using setLinearVelocity. Here is the first test, there are still some issues with the camera but I guess I’m in the right track:

Character controller test