I can’t seem to change the offset on my material of the texture
This is the two things I’ve tried.
Also it doesn’t work by changing it in the inspector either.
material.mainTextureOffset = new Vector2(Random.Range(0,1f),0);
material.SetTextureOffset("_MainTex", new Vector2(Random.Range(0,1f),0));
I have problems even with shaders properly set up in many cases.
Definitely have <tex_name>_ST declared and using TRANSFORM_TEX as well.
Used to work in 5.4.3.
Thanks @npatch1
My large issue right now is I don’t know C++ or what ever shaders use.
Here is my shader script below
I couldn’t make those changes work.
Gives me fatal error with using TRANSFORM_TEX return value on o.textcoord
Unity shaders are just HLSL now, not Cg. It was originally Cg, but if you try to use features that were unique to Cg it will fail. The code outside of the CGPROGRAM blocks (which are really HLSLPROGRAM blocks) is Unity’s own ShaderLab language which is a very simple markup language used to tell Unity how it should use the shader code when rendering. Because it was originally written to wrap around Cg there are some vestiges of that, like the use of CGPROGRAM / ENDCG and “fragment” shader vs “pixel” shader.
oh wow nice catch haha. I guess I rely on my editor to much. My editor doesn’t support that language so it didn’t catch that lol.
It works now. I don’t any difference though.