I am using the quick outline material on the unity asset store but it doesn’t work with skinned mesh renderers that have multiple materials (only one material will be picked to be outlined)
I’m not totally sure how to fix it and would absolutely love if anyone could offer any guidance, thanks!
I FOUND THE SOLUTION!
After hours of going through some information and other outline solutions, simply adding the following code in the Awake function of the Outline.cs (at the very top) will fix it, I am not totally sure how well some of the features work but the outline works perfectly from my tests.
foreach (var skinnedMeshRenderer in GetComponentsInChildren<SkinnedMeshRenderer>())
{
if (skinnedMeshRenderer.sharedMesh.subMeshCount > 1)
{
skinnedMeshRenderer.sharedMesh.subMeshCount = skinnedMeshRenderer.sharedMesh.subMeshCount + 1;
skinnedMeshRenderer.sharedMesh.SetTriangles(skinnedMeshRenderer.sharedMesh.triangles, skinnedMeshRenderer.sharedMesh.subMeshCount - 1);
}
}
foreach (var meshFilter in GetComponentsInChildren<MeshFilter>())
{
if (meshFilter.sharedMesh.subMeshCount > 1)
{
meshFilter.sharedMesh.subMeshCount = meshFilter.sharedMesh.subMeshCount + 1;
meshFilter.sharedMesh.SetTriangles(meshFilter.sharedMesh.triangles, meshFilter.sharedMesh.subMeshCount - 1);
}
}
Disclaimer, the second portion (involving meshfilter) was not tested but it should work the same as with the skinnedMeshRenderer