- Home /
[c#] Create visible appearence of a grid using texture or models
I am curious as to how i can create the look of a criss cross game grid, by repeating a texture or model. I am looking for something similar to this: Sample Grid from another game
My game level is meant to be dynamic, so i cannot just stretch the grid or duplicate my model with the transparent texture. How would i do this in unity? My levels will be quite big, so i am unsure if using a loop and instantiating objects will use up too many resources.
Answer by Mortoc 1 · Feb 01, 2012 at 09:14 PM
If you have Unity Pro, the GL API will get you there using the GL class.
// Not tested, but something along these lines (ha) should do the trick GL.Begin(GL.Lines); Graphics.DrawMeshNow(myPregeneratedGridMesh, Vector3.zero, Quaternion.identity); GL.End();
Hmm I am confused on what that really does. Is this customizable? As in can i change long thickness, color and etc? And how does it know the ends of my level? Does it align my meshes so they line up?
Your answer
Follow this Question
Related Questions
What is the fastest shader? 2 Answers
Compare texture from array to another one in list 1 Answer
Random textures... 1 Answer
Accessing a Variable From Another Script 2 Answers
script communicate with each other 0 Answers