Hi,
I’m looking at how to change the flag of the “Two sided” in my script.
by default it is deactivate when I add it to an object. So I need that my script change the value to true after adding it to the object :
Renderer rend = Object3D.GetComponent<Renderer>();
rend.material.shader = Shader.Find("Particles/Standard Surface");
I’m not sure what shader that is off hand, built-in or custom, but normally a toggle like that would be set with Material.SetInt() with a value of 1 for on or 0 for off. If that’s a built-in shader though, it’s possible that’s a custom inspector and the values are more complicated. I’d recommend loading the proper material, instead of a shader, with the correct values already set.
but the thing is, I use the property of the particule shader to add the color of the mesh to the texture to differentiate when the object is selected of when he is not.
so I’m a bit at loss here. my build-in shader have the option Two Sided, and in the editor I can change it, I juste need the name to access it an modiffy in runtime. I don’t have any custome or add-on. I’m new to Unity. So it’s weard for me that I can’t have acces to un toggle in runtime when I see it in the editor.