Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Panel size jitters while the TextMeshPro text inside it is smooth (while changing coordinates)

Discussion in 'UGUI & TextMesh Pro' started by Andefob, Feb 9, 2023.

  1. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    100
    I have an option in my game to show player names on top of their cars. This is done by updating the exact position of the text every tick. The text is made with TextMeshPro and it works just fine.

    BUT, when I try to add a bar (for background, health, fuel or whatever), simply having a panel with no image, its size or height or y-coordinates are jittering when the position is updated.

    See the video to understand what I mean. The parent of the text has a black panel and it is not as smooth as the text inside. Check the upper and lower edges of the black background panel:
    https://drive.google.com/file/d/14dqotuuOJ5Wd40tc881KFrd7KNrFO2k8/view?usp=sharing

    It does not matter what the size of the panel is, it still happens. It also doesn't matter if the size is based on explicit height or anchor positions. I have tried to change the canvas settings but whether or not it is pixel perfect has no effect. I am using Canvas Scaler (Scale with Screen Size 1920x1080) but changing its settings or removing it does not make the issue disappear.

    In short, I would like the panel to behave as smoothly as TextMeshPro when coordinates are changed. Any idea how to do that and get the same effect with normal panels, too?