Home > Back-end >  UNITY 2D - How to add RectTransform.height without affecting it's Y position
UNITY 2D - How to add RectTransform.height without affecting it's Y position

Time:12-04

What's happening:
enter image description here

Everytime I add value to height.. the 'top-most' area is causing to mess-up the y.position of the gameObject.

The GOAL is:
enter image description here


How to achieve this kind of approach/behavior via script that makes the 'top-most' area stay?

Thank you in advance. Best regards.

enter image description here

CodePudding user response:

The default anchoredPosition is in the center by default. You'll need to set it to the upper left corner. There is a sample code shown enter image description here

  • Related