umasteeringgroup / UMA

Unity Multipurpose Avatar
MIT License
739 stars 168 forks source link

UMA Renderer resets Layer to default when cloth recipe is removed #398

Closed OldVikingGamer closed 6 months ago

OldVikingGamer commented 1 year ago

If you have an UMA with the UMA Renderer set to a layer that isn't "default". When a recipe that uses cloth is removed from he UMA, the renderer is set to the "default" layer and doesn't respect the layer it was originally set to.

Bug found in

Unity 2021.3.7f1 UMA 2.12 Render Pipeline HDRP

Editor/Windows

To Reproduce Steps to reproduce the behavior

  1. Set UMARenderer object to a layer that is not the default layer
  2. Add cloth recipe
  3. remove recipe

Expected behavior UMARenderer object should have it's original layer

Additional context

Problem is in UMARendererAsset.cs, static public void ResetRenderer

Line 84 renderer.gameObject.layer = 0;

Its hardcoded to 0 instead of the layer that assigned

I have a workaround where I changed the hardcode to the layer assigned. And it is a bit of pickle due to static method vs instance value, but it is a bug. If it never gets fixed...lol I will live

OldVikingGamer commented 1 year ago

It may be as simple as commenting out line 84. I am not sure why that line exists or what it is supposed to do. Commenting it out fixes the issue but I do not know if it causes some regression issues.

Jaimi commented 6 months ago

Fixed in feature-13