Manage collisions between RigidBody and character

Godot Version

4.3

Question

I made a car in top-down view and i’m trying to make it collide with movable objects in a satisfying way. I’d like to be able to push or bump against them to move them, and i managed to do it by putting the object on a collision layer that isn’t masked by the player, but in this way the player keeps moving as if nothing was happening. So i tried to revert the layer change (both the player and the object have layer and mask 1) and add a script that applies an impulse to the object. In this way the object moves in a very unnatural way (if a push a long barrier from the side it still travels straight, without rotating) and the car accumulates velocity while pushing, so when i slide to the side of it the car just gets flung at an incredible speed. How can i slow down the player when colliding AND keep the same behavior in the pushed object as the first case?
Sorry if the question is dumb this is my very first project : /

this is the way to do it for things like debris and boxes.

what you describe sounds like you want the car to react to the objects.

I can think of two ways to do it:
1 - try setting a different mass for the movable object and car. if the car is a vehiclebody3D and the movable object is a rigidBody3D, they will both have mass.
2 - if your car is a characterbody, it will probably not have mass. in this case what you can do is keep them in different physics layers with the car moving the object but not being moved by it. and when it hits the obstacle you play an animation or apply a small force to the car from code.

How can i apply a force to the car when it collides, if the car itself has to be on a different layer? An area 2D on the car to detect “collisions” without actually colliding? I might have some trouble avoiding the car clipping in an object if the object is against the wall. Collisions seem hard : (. I’ll check how i can make it work later, but I’m not so sure I’ll be able to figure it out

that is a way to do it.

for characterbody, since it’s kinematic, you have to manually calculate and apply the force every frame, so you could use a timer to start using the force that would be added to the movement.
when the collision happens, the timer starts, you change a boolean, and that causes the force to be applied. when the timer ends, the boolean changes, force is no longer applied.
you could also get the direction of the impact by calculating the vector between the object global position and car global position, or just push the car back locally, which would be easier.