- Home /
Texture disappears in standalone (fine in editor)?
Hi everyone,
I'm having an unusual problem. I have a game that has always done just fine at a particular task: scrolling instruction textures upward on instruction segments of the game. These are not GUI based, they are placards in the game environment. They scroll upward through a speech bubble attached to a character in the scene.
I recently added a single scene to the beginning of the game which asks for a password before either loading the game title or closing the executable. I also upgraded Unity (from 4.1.5 to 4.2). Neither of these had me working at all in the scenes which required text scrolling, nor did I touch any code associated with text scrolling.
Yet! Now the text placards are blank and appear bring pink/magenta in-game, symbolizing no texture is applied. In the editor everything runs just right. In the standalone, after build, they are missing.
After checking the log, I found an additional line that doesn't appear in my in-editor log. After each card is loaded there is a:
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54)
Does this mean anything to anyone? I'm not sure what to change. Like I said, in the editor, everything works absolutely right.
Thanks for your help!
$$anonymous$$aybe a missing/unresolved material/shader. Do you use the Shader.Find() function?
No. I have a script that has a Texture 2D array. I use the Inspector to assign textures to the proper slots in the array.
The script cycles through this array as it cues text cards.
These work properly in the editor, and have worked properly in the game up until now.
Try putting your texture in a Resources folder. If it work, your texture are not referenced correctly
Answer by Ereptor · Oct 08, 2013 at 08:44 PM
I solved my problem! I just had to downgrade from Unity 4.2.1 to 4.1.5.
It seems that I'm having to return to this problem. I've had to go back to this file to make some changes with my new Unity 4.3.3 and the only solution I EVER found to my problem was to downgrade to 4.1.5. (While looking for a solution online, I found this post which I forgot about.)
I downgraded to 4.1.5 and re-imported my project from 4.3.3 and it turned to jumbled garbage. I had to fall back on my most recent back-up, fortunately only losing about a week of work. Now I'm going back and forth between 4.2.1, 4.1.5, and 4.3.3 and I haven't yet found a solution (though I have created many buggy, defected attempts).
The issue is simple: textures appear in-place in the editor. They are properly referenced, and accessible within the project folder: Assets/$$anonymous$$aterials/TextCards. When publishing to the executable file, the textures disappear and display as pink.
Any idea how to solve this in 4.3.3 and up? Downgrading my project causes it to lose data and become worthless.
I also noticed that removing the files breaks the link, and replacing them mends it. When the files are put back in the right place, a filename.png.meta file is created for each image. Is this important?