I wanted to create a glowing border for my 2D Jump’n Run. It works absolutely fine until entering the game view (See screenshots). Any Ideas? The Sprite and Emission Map are perfectly aligned, and as stated it works like intended while not starting the game…
The Secondary Texture is set to be the emission map, lining up exactly with the main texture. Tried to tinker around with the Sprite Atlas settings. I used it to get rid of visual bugs with my tileset. Any Ideas what could cause it?
Sprite Atlas, iirc, doesn’t show you the atlased version until you enter play. It was showing the perfectly aligned secondary texture version. So I suspected Sprite Atlas might be involved because you have a Play / no Play difference.
Tinkering around with the atlas might’ve just forced it to rebuild. What it was showing beforehand was a misaligned atlas, where the primary/secondary textures weren’t aligned.
Alright, I found the problem but have no valid solution to it im afraid. You were right, the problem is the sprite atlas, to be more specific it’s the padding. Not using an Sprite Atlas resolves this problem, but without using a sprite atlas I get weird vertical lines between tiles when moving. Any Ideas how to get it to work with a sprite atlas or without vertical lines? This drives me nuts…
You don’t need the emission tileset I don’t think. What the atlas is doing is constructing two parallel textures, pulling from the Secondary Texture info assigned the Sprite Editor. The pack preview looks like it has duplicate textures, from MainTex and emission, when they should be parallel.
If you haven’t already, go to “Show Platform Settings For” and check that your emission texture has the right settings.
I think everything is setup correctly, in the Preview window for the sprite atlas it aligns perfectly, just not during runtime. I removed the emission map as a packed Object, still no changes. It’s set as a secondary texture in the sprite editor as expected, and as said it aligns perfectly in the preview…
This is pretty weird. I’m out of ideas. Maybe it’s a bug, maybe it’s some completely different problem.
I would try creating a copy of the whole project then upgrading to 2021 to see if on the off-chance it’s a bug that has been fixed which for some reason wasn’t backported.
If you’re using chunked mode on your tilemap, this needs the same atlas / spritesheet. Resolving the issue by eliminating the atlas may be deleterious to performance.
Another idea is to create the spritesheet and parallel emission tex manually. I’d do a small test case for this before committing to it because it’ll be a pain. edit: this would isolate whether Unity’s Sprite Atlas is truly at fault or if it’s a red herring.
As for lines, there’s lots of threads on that question.
Thanks for testing it.
What do you mean by creating the spritesheet and parallel emission tex? They are already seperated… or did I misunderstand you?
Edit: Should I try the experimental Sprite Atlas v2? Just stumbled across that option…
Edit2: Okay, case dismissed. Aparrently I did assign the secondary texture name wrong. It said to use the name used in the sprites. I changed it to the name I gave the secondary texture in the sprite editor and it works now. Thanks for your support man, at last I figured it out…