I appreciate that this is probably me, but I’ve spent ages searching and can’t find a definitive answer.
I have created and rigged a 2d sprite. But whenever I move any part of him the edges get jagged, and lines seem to pan across the sprite.
I think this is probably down to the size of my sprite. Fully assembled he’s 64px tall and 51 wide. Or the Pixel art style, when rotating.
Does anyone with more experience than me know what the best way to fix this is? and if is (as I expect) to make a higher resolution sprite, what resolution would you suggest?
The jaggies you’re seeing are typical of low resolution 2D rotation. You’re always going to have a tradeoff between resolution and performance, so you’re going to have to decide for yourself where you want to position your tradeoff slider.
This is my first attempt at skeleton animation rather than sprite sheets. My current project is going to have at least 30 NPC’s as well as 15 unique bosses. So didn’t want to have to do sprite sheets for everything.
The feedback from my play testers was that the jaggies feel cheep and subtract from the action I’m trying to instill with my movement system. I guess I’m just going to have to try a bigger resolution, and zoom out in the camera to get everything back to the size i want lol.
You probably want to turn on linear interpolation for your textures, you might have set them to “Nearest” in the filter section either on a root node or in the project settings, I would undo that. For textures that were scaled down (or zoomed out) significantly you may have to enable mipmaps for a similar linear interpolation of small sprites.
Oh and enable MSAA 2D in the project settings > Anti Aliasing
Cool! Mipmaps will do nothing for you then, they are a way to performantly add linear interpolation.
For pixel art you may want the opposite approach of “zooming out”. You could have better results by reducing the viewport size, setting the strech mode to “viewport” and the scale mode to “integer” in the project settings.
If you scaled your player up to fit the screen it would be a good starting place to reduce the viewport size by how much the sprite is scaled and reset the sprite’s scale back to 1.0.
as a checklist:
divide the viewport size by the player’s scale
reset player scale
set stretch mode to “viewport”
set scale mode to “integer”
If you search for “window” or toggle the advanced settings on you can set a window width/height override so the game doesn’t start small.
On starting my new project I’d forgotten to change the stretch mode and scale mode. So they were still on “disabled” and “fractional” that’s suddenly got rid of the jaggies almost completely.
This is why I should set up a template project to use each time i start a new project haha. Thanks again