How to stop a rigidbody pushing another rigidbody?

So basically i’m trying to make a fighter and stop the 2 characters from moving too close to each other. Each character has a rigidbody and a cube collider that is their “personal space”, ie how close they can get to each other. I’m using my own controller script, for one because i want to and for another because i’m having some trouble with locking certain axes with the supplied ones.

The problem i have is that when a character moves into another character it pushes that character. I don’t want that but i cant seem to figure out how to stop it happening. Only way i can think of is to stop any movement on that axis when this specific collision occurs but there should be some other more elegant solution. Any ideas?

If this has been asked i apologize but i can’t find where :confused:

What do you want to happen when one character walks into another? This is a none trivial problem from your description. Are characters moving only in one axis or another? Or can they move diagonally at any angle?

Ideas to try when a collision happens

*determine which should not move and increase its mass.

*add a force to the character in the normal of the contact point of the collision based on the velocity of the incoming charcater

*Set one of the characters kinematic to prevent it from moving for a moment (got to turn it off again when it is over)

I set the collider of one object to “Trigger”, this fixed the issue for me.