How do I keep rigidbodies from pushing each other?

When both of my rigidbodies are set to dynamic they push each other like this. When I set one of them to kinematic like this it does keep them from pushing each other, but the problem is that kinematic rigidbodies don’t collide with other kinematic rigidbodies they just phase through each other.

You could add contraints to the rigidbody to hold it in position? You can just make one of the rigidbodies kinematic, like in your second gif. You can toggle Kinematics as you need them.
Ignoring collisions will make them move through, of course.

There is this : Unity - Scripting API: Rigidbody2D.simulated

But im not sure if this will ignore collisions (I assume you are using 2D)

But This : Unity - Scripting API: Rigidbody2D.useFullKinematicContacts

should help you (“Should kinematic/kinematic and kinematic/static collisions be allowed?”)

Since I couldn’t find a built in solution I made my own custom character controller. If anyone is interested in it here’s a download link GitHub - Bifumen/CharacterController2D: This is a simple character controller for "top down" 2D unity games