#Godot Physics Breaks.

11 messages · Page 1 of 1 (latest)

azure trout
#

Hey! I'm making a 2d game where the player is controlling a pool cue ball, and is trying to run into other pool balls. The balls and the player are all 2d physics objects, and the game works almost completely fine, but sometimes when running into a wall or another ball the player stops on a dime. The issue with this is it's entirely irregular, it happens with the walls, with the other balls, but only around a tenth of the time. I'd ignore it, but it is actively tripping up how movement is.

Here are some specifications:
The player and balls are all rigidbodies with a physics material of 1kg, 0 friction, and .95 bounce, and are not absorbant or rough.
The wall is a StaticBody2D with friction 0, Bounce .95, and is not rough or absorbant.
The player is using continous cast ray solver. and is a contact montior. The rest of the objects have this option disabled (Should i turn that on?).

The exact action that happens is two rigidbodies hit each other, while they both hit each other with a considerable amount of force, they both then become nearly stationary after the impact. This only happens 1/10 times, the rest of the times the bodies bounce as expected. The wall also replicates this behavior.

Is this an issue with godot physics? or on my end?

Thank you!

sick walrus
#

i would recommend enabling continuous collision detection for all rigidbodies and maybe even turning off can_sleep while testing

#

another thing thats always worth a try is increasing the physics ticks in the project settings. you can easily double it and see if it improves your bodies behaviors

#

im afraid godot 2d physics isnt perfect though and some rigidbody collisions may not work properly

azure trout
#

Continuous collision hasn't done anything, i've also arrived at two seperate issues depending on continuous type, with raycasts the player gets the same irregular collisions as before, but on cast shape it teleports into the wall and messes around like that.

Currently the ticks are 60, and while it does lessen the issue significantly, it still doesn't solve it, and i'm not really sure about performance issues, i want the game to be light weight ideally :/

Thanks regardless for the help!

meager maple
azure trout
sick walrus
#

Rapier2d is the only one that's maintained currently. Definitely worth a try.
Btw how are you moving the players ball?

azure trout
#

Wowie Rapier2D is actually incredible, not only fixed the issue but even fixed it at the level way way faster than i actually need

#

genuinely amazing big fan thank you

#

In order to move the player and other stuff i'm applying_central_force() to it whenever i want the player to move, this makes the movement super slippery but that's intentional 👍