/// <summary> /// Main constructor for gridnodes /// Takes in the gridnodes location and gridnode prefab object /// </summary> public GridNode(Vector3 pos, GameObject gridNodePrefab, float spacing) { myGridController = GameObject.FindWithTag("gameControllers").GetComponent <gridController>(); position = pos; gridNodeObject = MonoBehaviour.Instantiate(gridNodePrefab, position, Quaternion.identity); gridNodeObject.transform.parent = myGridController.transform; Debug.Log("gridSpacing: " + spacing); gridNodeObject.transform.localScale = new Vector3(defaultGridSize * spacing, defaultGridSize * spacing, defaultGridSize * spacing); // change its local scale in x y z format frameHighlighter = gridNodeObject.GetComponent <highlighter>(); gridNodeObject.GetComponent <GridNodeBehavior>().setMyGridNode(this); }