Boundary Code?

I’m having trouble finding a code that will function as a boundary, preventing one object from going “through” another and just stopping instead of bouncing off…

anyone?

thanks!

a/o