I have a sphere trigger that when it comes into contact with a rigidbody, will push it away. The problem is that it affects rigidbodies behind walls too. I don't want it to affect that stuff. So how can I somehow detect and not push rigidbodies if they are behind an obstacle?
I thought of using a raycast to check if sphere can "see" the rigidbody, but the problem is that if there's a small rb hiding behind a bigger rb, the small one is not affected anymore.
Any tips?
It shouldn't matter as long as they are tagged / layered differently. I haven't tested this, it's just a theory.
– GlennHeckman