Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question UI element doesn't align perfectly

Discussion in 'UGUI & TextMesh Pro' started by Pancho136, Jul 28, 2022.

  1. Pancho136

    Pancho136

    Joined:
    Feb 19, 2022
    Posts:
    7
    Hello!

    I created a canvas, with this settings:

    upload_2022-7-28_7-58-22.png

    Then, under this canvas I created a GameObject that has a 128x85 pixel image (let's say it's for the player inventory, PPU = 32). This GameObject is scaled to be 5 times bigger on both the X and Y axis.
    My problem is that when I click on the image, I see a small gap between the lines and the image, like this:

    upload_2022-7-28_7-55-33.png

    I can't understand why this happens. If I go to the GameObject that has my image and input something like 0.121(...) for Pos Y, it kind of aligns. This does not happen on the X axis, there it aligns perfectly.

    Any ideas? Maybe I'm drowning in a glass of water, but my OCD is killing me. I've tried multiple options but to no avail (changing the scale, changing reference resolution, changing UI Scale Mode, etc.)

    Any help would be much appreciated.
    Thanks!
     

    Attached Files:

  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,105
    The 2D forum is not related to UI. The forum for UI is here.

    I'll move your post for you.
     
  3. Pancho136

    Pancho136

    Joined:
    Feb 19, 2022
    Posts:
    7
    Thanks! Sorry for the mix up
     
    MelvMay likes this.