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
- [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
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
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