I’m making a 2D game with C#.
I have 2 rigidbody in my game: A and B. Both can move in the level.
Right now, when A touches B, B is pushed by A. I’d like to make it so that A stand still when pushed. And the same goes for B touching A.
How can I do that? Thanks!
Don’t use physics?
Write in the OnCollision2D function for both objects and set the opposite rigidbody to sleep or extremely heavy or turn on isKinematic during the collision.
I’m pretty sure you can also accomplish the same thing using physics materials.