Search Issue Tracker
Won't Fix
Votes
0
Found in
4.1.2f1
Issue ID
539169
Regression
No
Custom Editor that uses SerializedProperties works as expected until duplicating an object
Steps to reproduce :
- open the SpriteDemo scene.
- select one of the sprites.
- play with the "Texture" property so you can see the script work normally.
- duplicate (Cmd+D) the object.
- changing the "Texture" property on one of the objects will do nothing, on the other object will change both objects.
Explanation :
After some investigation, we found that it actually is caused by the mesh referred in MeshFilter is shared between duplicated objects.
When you change texture setting on the sprite, you change the underlying mesh's uv coordinates in TwoDeeSprite.UpdateMesh() function. And since you are not always creating a new mesh when a TooDeeSprite is instantiated (see TwoDeeSprite.Awake; mesh is retained if there is one), that leads to the phenomenon you've observed.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- MeshRenderer.sortingLayerID cannot be changed when change is being done in a built Player
- Warnings related to App Icon are being thrown when building project to VisionOS Platform
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
Add comment