I have a GameObject with a Rect Transform (I assume I should be using one) and I am trying to essentially spawn squares in a grid formation. However it starts from the middle and I want it to start from the top left.
I have tried adjusting the pivot but it seems to have no affect so I am pretty stuck.
Here is an image of what I have and the Rect Transform
Here is a snippet of my code for performing the Instantiation
rectTransform = GetComponent<RectTransform>();
Vector3 position = new Vector3(x * 1, y * -1, 0);
GameObject newPiece = Instantiate(PiecePrefabs[(int)type], position, Quaternion.identity);
newPiece.transform.SetParent(rectTransform);
I want this to start at the top left of the rect transform. (Assuming I should be using one).