Say for example I have a ball, I want the sphere collider to be a certain radius when it comes into contact with one material (material A in diagram) and a different size when it comes into contact with another material (material C in diagram). How would I go about doing this? (Diagram attached)



You need to create two empty child GameObjects of material C that work in different layers. One child has a sphere collider with a radius of e.g. 5, reacting to colliders in the layer "One" and one child using a sphere collider with the radius of 10 working in layer "Two". The colliders that react only to the collider with the radius 5 just only react to the layer "One". With layer "Two" the same.

Layer One collider

Layer Two collider

Now uncheck the interaction between "One" and "Two" in the physics manager:

Physics manager

Now for material A set the layer you want to use with the colliders and the problem is solved.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.