- Home /
Images have a weird behavior
I want to make a grid based game and for the grid I am using an image that is instantiate in a grid layout. But here is how everything should loock like:
but If is not close to the camera is getting very weird:
Pls help me what can I do to solve this problem or maybe how can I make a grid for my game. Maybe i have to change some setings but I didn't find anything
I think you would need to share some code if you're looking for help here.
My code is just Instantiating this image multiple times in a grid patern, is like put this images in the editor, problem is not in code but in rendering images. If you don't know how to solve this problem pls hepl me to make a grid, i tried with Debug.DrawLine but the problem is that I want to see my grid in builded game
I think you need line renderer to do that.
Answer by MSavioti · Mar 22, 2021 at 06:41 PM
To use line renderer, as you asked:
var line = gameObject.AddComponent<LineRenderer>();
var start = new Vector2(0, 0);
var end = new Vector2(0, -10);
var points = new Vector3[] {start, end};
line.useWorldSpace = true;
line.startWidth = 0.1f;
line.endWidth = 0.1f;
line.startColor = Color.black;
line.endColor = Color.black;
line.SetPositions(points);