What to do when Unity messes up your textures

So, Unity has been having problems working with textures recently. First, there was a single texture that got mangled. But only in the editor. Android and iOS builds with the same textures were OK. I supposed it was had to do with some bad memory and lived with it. Then NGUI started messing up the atlases. Hum. I though the atlas builder was having trouble and started using TexturePacker.

Finally today the last shoe dropped and PackTexture is giving me this kind of nonsense:

5299-mcarsandeffects.png

As you can imagine the sprites are not supposed to be cut in half like that. It looks as if unity thinks each sprite if larger that it actually is. Ho, and it also doesn’t save to the proper size. A 2048 texture packed by PackTexture is 1024x.

I think the problem is with the project itself. Some corrupted cache files maybe? Reimporting All didn’t do anything. Or emptying the Temp folder. Or rebooting the computer. Or upgrading to 3.5.6 (I’m using 3.5.5).

I’ve just faced similar problem.
To fix this. try to close unity remove all files and folders in YOUR_PROJECT/Library folder and start unity.

It will reimport all of your assets.

First of all Unity isn’t messing up your textures. NGUI is a third party extension. The TexturePacker is a completely seperate software so it also has nothing to do with Unity. You might use the UV information the wrong way…

We can’t help much since we have no idea where it goes wrong. We actually don’t even know what the picture you’ve posted is. Is it a screenshot? Is it your atlas texture? If so how has it been generated?

I still don’t know what went wrong, but in case someone else has the same problem, here is how I fixed it:

  • export your project as a package (Assets->Export Package…). Make sure to include everything.
  • create a new project
  • import the package
  • If you look at your scenes, you’ll notice some errors with the layers: they will be blank and it crashes if you run it.
  • Close Unity
  • Copy the content of the folder “ProjectSettings” from your old project to the new one.
  • Restart Unity et voila!

If you are trying to change color of your textures then simply copy your atlas Png image and change it in photoshop and replace it in your project.