Search Issue Tracker
Fixed in 5.0.6
Votes
2
Found in [Package]
5.0.5
Issue ID
1337463
Regression
No
[2D] SpriteResolver generates garbage every few frames when playing an animation
How to reproduce:
1. Open the attached project's Scene labeled "SampleScene"
2. Enter the Play Mode
3. Open the Profiler window (Window->Analysis->Profiler)
4. Input SpriteResolver.LateUpdate in the search field
5. Scrub through the Profiler graph
6. Inspect the GC Alloc value under the SpriteResolver.LateUpdate call
Expected result: Garbage is not generated every few frames
Actual result: Garbage is generated every few frames
Reproducible with: 3.2.6 (2019.4.27f1), 5.0.5 (2020.3.10f1), 6.0.3 (2021.1.8f1, 2021.2.0a17)
Couldn't test with: 2.0.0-preview.3 (Sprite Resolver is not available)
Notes:
- In Unity 2020.3.10f1, 64B of garbage is collected and it's more frequent
- In Unity 2021.1.8f1, 2021.2.0a17, either 272B or 236B of garbage is collected and it's less frequent
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 5.0.6):
For Unity 2021.1 & Unity 2021.2 (2D Animation 6.x and 2D Animation 7.x)
Sprite Resolver is only generating garbage if using an Animation Clip which animates Sprite Resolver and is created in Unity 2020.3 or earlier.
A solution would be to upgrade your clips to animate SpriteResolver.SpriteKey instead of SpriteResolver.Category & SpriteResolver.Label. This will solve the garbage generation.
Resolution Note (fix version 5.0.6):
Fixed in Unity 2020.3.14f1