Search Unity

Question Beginner question: Anchor position/yellow box position

Discussion in 'Getting Started' started by schroed, Nov 21, 2021.

  1. schroed

    schroed

    Joined:
    Aug 20, 2018
    Posts:
    4
    Hello,

    I am a unity beginner and currently working through a tutorial.

    My problem is that the yellow box/anchor doesn’t cover the text box like in the TUTORIAL-video.

    Instead the yellow box/anchor changes position if I zoom in or out.

    It happens even if I delete the Image or Text (TMP) and add a new one.

    For better understanding I uploaded a screenshot.

    Does somebody know a fix?

    Thanks
     

    Attached Files:

  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Those yellow boxes are an indicator of something different than the object's RectTransform. Honestly, I hate them. I think they get edited by default if you have the Transform tool active (instead of the RectTransform) when dragging the handles for the element, but there may be another way to change it inadvertently.

    This box represents the values for the Margins of the TextMeshPro element, something that can be found under the TextMeshPro - Text (UI) component's "Extra Settings" dropdown. Ideally, in my opinion, you'd want all those Margins values set to 0 and modify the positioning/sizing of the element with the RectTransform properties and/or Layout Groups as needed.

    upload_2021-11-22_9-42-11.png
     
    schroed likes this.