- Home /
A texture/material loading problem in Unity 4 iPhone
I'm making a game on unity 4 for the iOS system and meeting with a problem. I have some prefabs in the Resources
folder and these prefabs point to some materials in Models
folder, where the materials point to some textures under the same folder and use some specific shaders.
I use these prefabs programmatically by Resources.Load(pathToPrefab)
and instantiate the returned value and parent it to some existing GameObject
s in the scene. Sometimes I simply use NGUITools.AddChild(parentGameObject, Resources.Load(pathToPrefab))
(which calls`Instantiate()` inside).
But recently the testers reported that sometimes the instantiated things are on the screen but some of them are pink, which i think means that the link to the material or shader or texture is broken. This bug is quite random and I don't get a clue.
What will cause this problem? Is there something I've done wrong?
Thanks.