Search Unity

Snapping text to canvas doesn't work like in the videos

Discussion in 'Getting Started' started by tEXKFgF78, Jun 22, 2020.

  1. tEXKFgF78

    tEXKFgF78

    Joined:
    Jun 22, 2020
    Posts:
    1
    I was following a tutorial, and when the guy created a canvas and then a TextMesh Pro, his text was selected but you could still see the border of the canvas (at the same time), and this allowed him to snap his text to different positions. When I create a canvas and then the text, the text is selected, but the canvas silhouette disappears, so I can't snap it like he did; I have to move the text, then select the canvas to see where it ends, then select the text and move it a little more, then select the canvas to check...

    I looked up a different video on YouTube, and it shows that for the guy in it, it works exactly as for the one in the first video: as soon as they create the text, it looks as if both, the canvas and the text are selected. I am already in 2D view, and I restarted Unity to make sure it wasn't some quirk. I tried to search stuff with "canvas", "textmeshpro" and "snapping", but nothing with my issue shows up. So I am assuming that there's something simple that you have to do but nobody bothers mentioning in the videos, like clicking a key or something. How do I make it work?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hmm, OK, first of all, I don't recommend you be trying to arrange things visually based on eyeballing the edge of one thing compared to the edge of the other. If you want the right side of your text to be 8 units from the right side of the canvas, then you pick one of the anchor presets where the right side is relative to the parent, and type "8" into the Right field (or "-8" depending on how you've anchored it).

    Second, maybe lay off the YouTube videos and try reading the manual. It's actually pretty good.

    Finally, as to your question, yes, the Canvas should definitely be shown as a rectangle in the Scene view. Can't imagine why it's not doing that for you. If it helps, try switching to Rect Tool mode; I often use that when laying stuff out because it makes the border easier to see, and because sometimes you really do want to just visually drag the borders around to fine-tune the size to fit your content.
     
  3. Bloodjoker666

    Bloodjoker666

    Joined:
    Nov 26, 2020
    Posts:
    42
    Hi,
    "try switching to Rect Tool mode" that was exactly what I neened. Thanks Joe Strout!
     
    JoeStrout likes this.