Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to fix corrupted Android project? (normal maps don't work etc.)

Discussion in 'Editor & General Support' started by SoftwareGeezers, Nov 7, 2014.

  1. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    898
    Edit: Is it safe to copy assets from one project to another or can that break projects? After this...

    Original Post : I have a game using Facebook, NGUI, and Android Native plugins. Android Native killed Unity when I tried to update, so the plugin creator recommended I create a new project with Android Native and copy across everything from the original project folder. So I did this and it looks like it worked, but I'm finding WEIRD errors. 1) I had a script on an object but it was calling the wrong script. 2) Normal maps come out red. Who knows what else is wrong.

    If I switch to PC, normal maps work, but not for Android.​

    ... I found that the same project allowed Android Native to be imported on another attempt and the project worked (although wouldn't build :mad:). As the difference between projects is that I copied loaded assets with their metafiles from one project to another, it that basically dodge? Would one have to import, one by one, every single asset file into a new project to trust Unity won't spazz out like this?
     

    Attached Files:

    Last edited: Nov 8, 2014
  2. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Are you sure they don't work? There's nothing wrong with that image, as long as the X normals are stored in the alpha channel. Y is in green, and the other two channels don't matter. If the shader assembles the normal as X = alpha, Y = green, Z = 1 - X^2 + Y^2, then you're good to go.
     
  3. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    898
    Yep, they don't work. The bumps on the object are wrong (pretty much flat and dark). Also, it's wrong behaviour from Unity which always shows blue-like normal maps as you'd expect. And importantly, the same project earlier before it went tits up had proper blue normal maps. And working scripts.Even if the new normal maps would work with a different material, they aren't working with the material that did work with them. Plus all the rest of the game is crazy too, not just the normal maps. I have scripts being called wrongly (scripts not attached to objects getting called by those objects), and the score mechanic was completely shot (starting with 8 points instead of 0 and the score jumping around randomly).

    It seems related to the whole Unity object corruptions I've had in the past. I seems that the object structure can get its knickers in a twist and everything muddled by copying/pasting assets/objects.

    Maybe my question is wrong and I should phrase it differently. I'll edit the OP.
     
    Last edited: Nov 8, 2014
  4. Andreea92

    Andreea92

    Joined:
    Sep 13, 2015
    Posts:
    2
    Your map probably is in 16 bits, you must have the maps in 8 bits for Unity.