Friday, July 1, 2022
HomeGame Developmentunity - Place object in high left of Rect Remodel 2D

unity – Place object in high left of Rect Remodel 2D


I’ve a GameObject with a Rect Remodel (I assume I must be utilizing one) and I’m making an attempt to primarily spawn squares in a grid formation. Nonetheless it begins from the center and I need it to start out from the highest left.

I’ve tried adjusting the pivot nevertheless it appears to haven’t any have an effect on so I’m fairly caught.

Right here is a picture of what I’ve and the Rect Remodel

Image of editor

Here’s a snippet of my code for performing the Instantiation

rectTransform = GetComponent<RectTransform>();
Vector3 place = new Vector3(x * 1, y * -1, 0);
GameObject newPiece = Instantiate(PiecePrefabs[(int)type], place, Quaternion.id);
newPiece.remodel.SetParent(rectTransform);

I need this to start out on the high left of the rect remodel. (Assuming I must be utilizing one).

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments