Question by
brendanbanfield · Aug 02, 2021 at 04:01 AM ·
c#modding
Making an object created in scripting appear through other game objects
I'm trying to mod a game made with unity, so I have access only to scripting. I'm creating objects that consist of basically nothing but a mesh renderer.
GameObject go = new GameObject("Mesh", typeof(MeshFilter), typeof(MeshRenderer)); go.GetComponent().mesh = CreateMesh(new List()); go.GetComponent().material = _material;
These objects need to be on top of the screen at all times, but despite trying several things there's one object that keeps covering them. What I've been trying is
_shader = Shader.Find("Hidden/Internal-Colored"); _material = new Material(_shader); _material.SetOverrideTag("Queue", "Overlay"); _material.SetFloat("_ZWrite", 0); _material.SetFloat("_ZTest", 0); _material.renderQueue = 5000;
I'm taking a default shader and modifying it because I've been unable to import a shader (Shader.Find() won't find it even as an embedded resource). Despite several things that should, by my understanding, guarantee my objects appear on top, they get covered by anything that appears after they do. Every other object has render queue 3000 as far as I can tell. Any ideas what's going on or how to fix it?
Comment
Your answer
