couple examples of a script ive made that can assist with clipping issues when making a modular character system, have meshes that were not explicitly modelled with each other in mind but want to use them together? within reason this can help to an extent
there are kinks for me to work out and artifacts on some of the more awkward combinations (like two full chest pieces together) but its pretty great at fixing random minor clipping like sleeves to gloves, hair under hats, breastplate over clothing ECT
What this system does at a functional level is basically the following;
1. Copy all meshes that will be used for tracing into their own dynamic mesh
2. Give each mesh a priority value for the overlap trace
3. iterate through lowest to highest priority mesh, then iterate through each of its vertices
4. trace inwards (either use bone weight avg location or vertex normal or combination) and look for higher priority mesh hits
5. using the highest priority hit location, get a location just below that for the vertex offset
6. convert the offset position into linear color (0.5 vertex color is the *origin*) for example -6/6 units could be mapped to 0-1 linear color input
7. (I used a plugin) apply the vertex color to each vertex for use in material world position offset
8. In material get vertex color and unpack that from 0-1 back into -6/6 and offset the vertex using its pre skinned position
9. use that same offset intensity (get vector length) to push the verts backwards from camera / cull entirely if necessary to prevent any final clipping issues (especially during animation)
the inspiration for this system (functionally pretty different but was a good resource for when i was starting) https://www.gdcvault.com/play/1022822...