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
- Inspector's custom tooltip is displayed incorrectly when the name is truncated in UI toolkit
- Crash on ScriptableRenderLoopDraw when rendering a specific VFX in Play Mode
- The script is not renamed in the Project window when renaming and a compilation Error is present
- Average FPS in Play Mode degradation on a newly created BiRP project when it's upgraded from 2020.3.48f1 to a newer Editor version
- DecoratorDrawer indentation is incorrect when it is called with EditorGUI
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