Sorting properties are unaffected by component copy-pasting

Avatar
  • updated
  • Declined

Summary

When copy-pasting a Shapes component, sorting layer and sorting order parameters are unaffected.

Image 187

Steps to reproduce

  • Create a Line component (or any other Shapes component)
  • Change its sorting layer and/or order
  • Copy component
  • Paste component as new on another GameObject / Paste component values in another Line component

Observation

Sorting layer and order are unchanged on existing components when pasting values.

Sorting layer and order have default values when pasting component as new.

Reporting a bug? please specify Unity version:
2020.1.11
Reporting a bug? please specify Shapes version:
2.3.2
Reporting a bug? please specify Render Pipeline:
Avatar
Freya Holmér creator
  • Declined

I don't think this is fixable in a stable way unfortunately, since sorting layer/order are serialized in the (hidden) mesh renderer component. I could possibly introduce two new serialized fields in my own component, but I worry about potential mismatches between the components that might introduce more bugs than it's worth