Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Texture appears Pink on iPhone (works on editor)

$
0
0
Im trying to apply a simple texture to a Gameobject (plane) that i have created during runtime. Im choosing a simple jpeg image stored in my "Resources" folder, loading it and trying to apply it as a texture. Heres the following code snippet in my Gameobject class: Texture2D staticTex = (Texture2D)Resources.Load("test"); Debug.Log("ULog Texture Size Width " + staticTex.width + "ULog texture Size Height " + staticTex.height); MeshRenderer renderer = plane.AddComponent(typeof(MeshRenderer)) as MeshRenderer; renderer.material.mainTexture = staticTex; This works fine on the editor, but i get a pink texture on the iPhone. Im using: Unity : 5.5.0f3 Xcode : 8.0 iOS : 10.0.2 This used to work as expected in previous builds but has just stopped working now. I have tried: 1. Clearing the GI cache 2. Making sure shaders are included by adding a test shader. Not sure what is going wrong, or what has changed. Any help is appreciated!

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>