Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMeshPro stretched text.

Discussion in 'Getting Started' started by pod11, Oct 22, 2020.

  1. pod11

    pod11

    Joined:
    Jan 6, 2019
    Posts:
    60
    I just started using TextMeshPro today.
    I want it in screen world so im ntonusing it as gui.

    I want it as a child of another object ( a square used as background that is a child of another rectangle).
    For some teason when i modify text field size after adding it - to match size of background rectangle- text in it gets stretched instead of having its proportions kept and jsut pick font size.
    Can't find any option to disable stretching, is there something im not finding, or is there a trick to make text not stretch weirdly depending on " textField?
     
    Last edited: Oct 22, 2020
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Can you share a screenshot of what you're seeing in the scene view, along with the hierarchy and RectTransform of the affected component?
     
  3. pod11

    pod11

    Joined:
    Jan 6, 2019
    Posts:
    60
  4. pod11

    pod11

    Joined:
    Jan 6, 2019
    Posts:
    60
    Now that i came back to project i realized that this effect occurs oly when i create TMP object as a child of rectangle.
    its probably somehow inheriting something form parent objects.
     
  5. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I can't make out the text in your scene, but I can clearly see your text object has its scale Y set to 0.8, while X and Z are 1, which would definitely explain some stretching. You generally don't want to scale text elements in that way, and would be better off changing the Width and Height properties instead.
     
    SuperAdi06 and Joe-Censored like this.