r/Unity2D • u/djwyte • 22h ago
Question/Help Need sprite position help.
I’m new to Unity and I’m sure it’s an old question/subject but I’m having issues with some sprites. My hero character has some moves that aren’t appearing to line up exactly where character sits in gameplay. I’ve tried sprite editor but it’s like blind guessing.
Any advice on making sure each move is aligned to main idle? Or possible tutorials that will help a non-coder learn the program better? I’m asking because sometimes there’s just a lot of crap out there so hopefully someone can guide me the correct way and help save time.
Thanks
0
Upvotes
•
u/AutoModerator 22h 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/One-Fig1282 21h ago
In Assets, click on spritesheet, open sprite editor, slice on top bar to grid by cell size, find the size generally mentioned in assets and slice. If you did this and it's still a few pixels off you need to manually adjust custom pivot point of a sprite in the sprite sheet.
2
u/VG_Crimson 17h ago
I'm pretty sure this is a setting somewhere that fixes your issue. Click on the asset/art. There should be settings for pivot. You can align it to the bottom (often the case for entities where footing matters) or center pivot. You can even do custom pivot.
1
u/One_Yam4643 52m ago
Adding to the pivot answers: the usual reason the moves don't line up with idle is that the frames aren't all the same size. If the sheet was sliced with Automatic, Unity fits each frame's box to its own visible pixels, so a Center or Bottom pivot lands on a different spot of the character in every frame, and the character seems to slide or hop when the animation changes.
Two ways out, no code needed:
Quick check: drop the idle sprite and one attack frame into the scene at the same position. If the feet don't overlap, that frame's pivot is off.