public void CreateNewLine(List <Vector2> pointsList) { // Create line renderer component and set its properties GameObject lineParent = Instantiate(Resources.Load("Prefabs/Line")) as GameObject; lineParent.transform.parent = gameObject.transform; Lines.Add(lineParent); DrawLine drawLineScript = lineParent.GetComponent <DrawLine> (); drawLineScript.DrawCompleteStroke(pointsList); }