So I was making an in-game layered clothing customization for my game, and came a cross clipping issues. See in the video
As you can see, pants are visibly clipping through jacket, even tho pants order is lower, and additionally vest is clipping through lower torso, even tho lower torso does have a WrapTarget.
After some messing around with the properties I don’t even remotely understand, this solved all the clipping issues.
character.DescendantAdded:Connect(function(descendant)
if descendant:IsA("WrapLayer") then
descendant.AutoSkin = Enum.WrapLayerAutoSkin.EnabledOverride
end
end)
After this, clothing no longer clips thorugh each other, or through torso.
Does it have performance issues?
I haven’t noticed any performance difference while playing, but the game is going to be a big RPG with 20-30 players wearing layered clothing in 1 server. Will this affect performance?
Without AutoSkin, the LC garments will use whatever skin weights they were imported with to control their deformation. In your example, it’s likely that the skinning of the waist of the pants and the waist of the shirt are different, eg the weight of the lower torso is not the same, so they deform differently when animating, causing intersections. When you turn on AutoSkin, the imported weights are ignored, and new weights are generated procedurally using the body mesh. These weights should match across the seams for all garments, so that is probably why the intersections go away. I have not profiled it, but the cost of AutoSkin should be relatively minimal, and only occurs once when the clothing is first applied. There is no additional cost per frame when animating. If you decide to use this feature, that also means you do not have to skin the garments in your DCC.