How do you make an object unable to move you when it hits you?

Right now im making a game like soccer heads. But i have a problem; when the ball hits something such as player 1 or 2, it makes me or them move a bit. When i decreased the ball’s mass to 0.0001, it no longer does that, however it bounces too much now and is too light. Is there any way I can make the ball unable to affect/move the players when it hits them? Thanks!

If you want the game to use Unity’s realistic physics engine then you would need to find a combination of player mass / soccerball mass that gives you the intended effect. You could also write a script that immediately “kicks” the soccerball whenever OnCollisionEnter is called. If the soccerball immediately starts moving in the opposite direction, or some calculated direction at some calculted speed, that it was moving on contact with a player, then the soccerball won’t knock the player backwards too much, as it didn’t spend too much time in contact with it.


Here is the documentation on OnCollisionEnter, assuming your game is 2D like soccerheads: