- Home /
Unity 4 Error UCE0001 constantly appearing
I have this script, copied EXACTLY from a YouTube video (and it works on the video): Shader "Custom/Mask": { Properties: { _MainTex ("Main Texture", 2D) = "white" {}; _Mask ("Mask Texture", 2D) = "white" {}; } SubShader: { Lighting On; ZWrite Off; Blend SrcAlpha OneMinusSrcAlpha;
Pass:
{
SetTexture [_Mask] {combine texture};
setTexture [_MainTex] {combine texture, previous};
}
}
}
The problem is that at position 2:70 there is supposed to be a semicolon APPARENTLY. But no matter how many times I try to follow the error's instructions it just keeps happening. Also there is no 2:70 it's just too far away from the code. Why is this always happening? I have Unity 4.0.
Answer by Dave-Carlile · Dec 03, 2012 at 07:15 PM
This should be a bit closer to the correct syntax. I'm not sure your SetTexture calls are correct, but I've not done much with surface shaders yet. There are many examples available in the documentation: http://docs.unity3d.com/Documentation/Components/SL-SetTexture.html and the SetTexture calls look quite a bit different there. Pretty sure there are no colons or semicolons needed though.
Shader "Custom/Mask" {
Properties {
_MainTex ("Main Texture", 2D) = "white" {}
_Mask ("Mask Texture", 2D) = "white" {}
}
SubShader {
Pass {
Lighting On
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
SetTexture [_Mask] { combine texture }
setTexture [_MainTex] { combine texture, previous }
}
}
}
Answer by KurtBeley · Dec 04, 2012 at 02:59 AM
Thank you for your reply but that code still gives me errors, some are the same UCE0001 errors and some are different. My copy of unity is not recognizing some of these commands. :/