Search Unity

Why won't TextMeshPro stay still?

Discussion in 'Getting Started' started by smatpat, Aug 13, 2020.

  1. smatpat

    smatpat

    Joined:
    Jul 27, 2020
    Posts:
    13
    Hi,

    I'm creating a 2D pixel platformer and I'm using TextMeshPro to display text in the game.

    I have my canvas set up as the parent layer and the TextMeshPro as a UI element.

    The canvas is set to pixel perfect, using the main camera as the render camera, with 100 for plane distance. The UI scale mode for the canvas is set to 'constant pixel size', with scale factor as 1.

    I place TextMeshPro into the canvas and it displays in the Scene view. All good.

    But, when I start my game, the TextMeshPro has moved to a different part of the scene. If I scale the game down while it's playing, the TextMeshPro is in a different place. If I expand the game while it's playing, the TextMeshpro is in a different place.

    How do I get it to stay exactly where I put it, no matter the size of the game window?

    Thanks :)