Question by
Niks4Linux · Dec 17, 2016 at 07:04 AM ·
shadersunity5
Material doesn't have a texture property '_CameraDepthTexture'
I had a project in Unity 4.6 and now I upgraded it to Unity 5.4. But When I run my project it gives me error as -
Material doesn't have a texture property '_CameraDepthTexture'
UnityEngine.Material:GetTexture(Int32)
In Unity 4.6 everything was working fine.But in 5.4 I'm getting this error. Does anybody know whats wrong with the material? And this is the code where it's showing an error.
Color32[] data;
Texture2D texture;
Texture2D currentTex;
public void ResetData()
{
data = currentTex.GetPixels32(); // gives error at this line
Texture2D newTexture = new Texture2D(currentTex.width, currentTex.height);
newTexture.SetPixels32(data);
GetComponent<Renderer>().material.SetTexture(0, newTexture);
texture= newTexture;
texture.Apply();
}
Comment
Your answer
Follow this Question
Related Questions
Transparent shaders make my custom plane completly invisible 1 Answer
Reproduce MagicaVoxel Shader in Unity3D, how? 1 Answer
Make albedo transparent and keep the glossiness and reflection visible - standard shader 0 Answers
Mix Shaders Question -- Multiple Textures, Recolorable? 1 Answer
Standard Cutout Double Sided? 0 Answers