- Home /
material problem in web player
Hello, I am trying to make a changing room. The model is in 3D and materials are loaded using assetbundle. But some materials will turn to black when I played it in webplayer. The materials is ok when I played it in Unity Editor and desktop published version. Can anyone please explain why?
Answer by Tommynator · Sep 22, 2011 at 11:11 AM
Make sure to use Push/PopAssetDependencies properly and read this section of the unity manual carefully.
It would also help if you post your export script to see if there is a possible point of failure.
Cheers, Tommy
I am only using the basic export from example: public class ExportAssetBundles {
[$$anonymous$$enuItem("Assets/Build AssetBundle From Selection - Track dependencies")]
static void ExportResource () {
// Bring up save panel
string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
if (path.Length != 0) {
// Build the resource file from the active selection.
Object[] selection = Selection.GetFiltered(typeof(Object), Selection$$anonymous$$ode.DeepAssets);
BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets);
Selection.objects = selection;
}
}
[$$anonymous$$enuItem("Assets/Build AssetBundle From Selection - No dependency tracking")]
static void ExportResourceNoTrack () {
// Bring up save panel
string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
if (path.Length != 0) {
// Build the resource file from the active selection.
BuildPipeline.BuildAssetBundle(Selection.activeObject, Selection.objects, path);
}
}
}
I don't really understand with how the asset dependecy work. Any easy solution? But I will read about it again.
Answer by Adhicl · Sep 25, 2011 at 10:37 AM
I found why. It is because the texture is in DDS format. Convert it to PNG and there is no problem. Thank you for the replies
Your answer
Follow this Question
Related Questions
Only on Mac OSX: Rendering/shader error within webplayer 0 Answers
Material doesn't have a color property '_Color' 4 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Changing two different objects renderer colour 1 Answer
Webplayer problem with material 0 Answers