EDIT: So it seems to work if I just instantiate one gameobject and not the 4 to make up the four sections of the line. The hell? Can you only have one line renderer in the scene? I DO have them as seperate gameObjects, each with their own line renderer… Hmm.
So I am trying to draw a box on the screen with line renderer. was able to draw a single line no problem, but now I cant get it to work. Not sure what happened…
I have a prefab with a line renderer component, I have tried changing around the properties. When I drag it into the scene, its fine. See picture:
But when I instantiate the prefab from my script, it shows up blank!
GameObject top = Instantiate(linePrefab, new Vector3(curMousePos.x, (curMousePos.y - 1), curMousePos.z), Quaternion.identity) as GameObject;
Picture of the blank instantiation:
I am at a loss, I cant figure out why it is blank when I instantiate via code. Cant find anything in the manual that describes any special action I need to take with instantiating line renderers. Worse, I had it working fine as a single line, now when trying to instantiate multiple lines it doesnt seem to work - arg!