Search Issue Tracker

By Design

Votes

0

Found in

2021.3.46f1

2022.3.52f1

6000.0.27f1

6000.1.0a4

Issue ID

UUM-87791

Regression

No

Editor freezes when selecting a GameObject in Play Mode with a script containing a public byte array

--

-

Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/SampleScene.unity“ Scene
3. Enter the Play Mode
4. Select the “Avatar“ GameObject in the Hierarchy window
5. Observe the Editor window

Expected result: The Editor does not freeze
Actual result: Editor freezes

Reproducible with: 2021.3.46f1, 2022.3.52f1, 6000.0.27f1, 6000.1.0a4

Reproducible on: Windows 11
Not reproducible on: No other environment tested

Note: In some versions, Unity freezes for a few seconds when selecting the "Avatar" GameObject, while in others it becomes completely unresponsive

  1. Resolution Note:

    In this case the user assigns the contents of an image to a public byte array in Start() which will generate hundreds of thousands of UI Elements to display it in the inspector. This is very expensive and can be avoided by making the byte array private or by using [HideInInspector] attribute. In this particular case I would recommend making this private because there is no reason to serialize a value that is always overwritten in Start().

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.