Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Strange gap between 2D objects

Discussion in '2D' started by Zeepblok, Jan 14, 2016.

  1. Zeepblok

    Zeepblok

    Joined:
    Sep 26, 2015
    Posts:
    15
    Hi all,

    I'm having a little problem. I'm trying to get 2 objects next to each other but there is always a space between them. I put one at X position 1 and one at X position 2 but still they have gaps. I tried a new object and new sprites, I even removed the images completly and added them one by one instead of using a spritesheet but still the same problem, please help gap.png
     
  2. Jaap_Smit

    Jaap_Smit

    Joined:
    Oct 3, 2015
    Posts:
    5
    By looking at your box collider I can guess the height and width of your sprites are 0.6. The pivot point is in the middle of the sprite. So when you position the first one on position x1y1z0. The right border ends at point x1.3.
    You can fix this by adjusting the pixel per unit, click on the imported sprite and you will see it.
     
    Zeepblok likes this.
  3. Zeepblok

    Zeepblok

    Joined:
    Sep 26, 2015
    Posts:
    15
    Thank you that fixed it :D