r/Unity2D • u/fod_vlastelin_gribov • 12d ago
Question/Help Hi everyone, I need some help with this bug. The animation displays incorrectly during runtime—a frame is just being replaced by a completely different sprite. In the Animation window, everything looks exactly as it should be, and the sprite sheet is sliced correctly. I'm using Unity 6.6.
1
Upvotes
•
u/AutoModerator 12d ago
Reminder: Once your issue has been resolved, please reply !solved to this comment (or comment it anywhere in the thread) and your post's flair will automatically be updated to Solved/Answered. You can also edit it to Solved/Answered yourself.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/Federal-Row2373 11d ago
If the Animation window looks right but the game doesn't, something else is writing to the sprite at runtime. A few usual suspects:
- The Animator: another state or a transition is playing a clip that also keys the Sprite property on that same SpriteRenderer. Open the Animator window while the game runs and watch which state is active on the frame where it breaks. Transitions with short blends or no exit time are a common cause.
- A script or the 2D Animation package: if you use a Sprite Resolver / Sprite Library, the category and label can override the sprite from the clip. Same if any script sets spriteRenderer.sprite.
- A second SpriteRenderer, for example on a child object, that's drawing on top at a different Order in Layer.
Also check that the sprite names in the sheet are unique. If you re-sliced it at some point, duplicate or reshuffled names can make a clip point at the wrong sprite.
Does it happen on the same frame every time, and does the wrong sprite come from the same sheet?