- Home /
Sprites rendering slightly off world coordinates
Hello! I've run into a very odd problem and I haven't been able to find a solution to this after a good while of searching. I Have a spritesheet containing 4 sprites, that has the same settings I've used for all other sprites in my game (Point no filter etc, standard pixel art stuff)
However, once they're in the game world the sprite is slightly off what It should be, as seen in the screenshot below. The sprite is at grid world coordinates (x-3, y25, z0), but it isn't aligning with my other objects which are also at grid world coordinates. It's not just the texture that's off either, it's the whole sprite object. Aligning the object itself to fit the rest of my game would leave it at around y24.98.
I have tried reimporting the spritesheet, messing around with a bunch of settings, all sorts of other things but nothing seems to work.
Looking at the preview grid background in your image, what's the base resolution of the image? Is it non-power-of-2?
The game's unit size is 32x32 and the camera is set to 640x360 with the pixel perfect camera component, resulting in an Orthographic size of 5.625 during runtime, but the issue i'm having is also present in the scene editor.
Answer by Nomiis · Jun 10, 2021 at 05:06 PM
Solved the issue. The parent grid of my tilemaps for some reason had a cell gap of -0.001 on x and y, and this offset the whole tilemap very, very slightly. I don't remember changing this value myself, don't know why I would either, but I did update my project recently so it might've been from that. Changing this to 0 on both axis fixed it.