Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Positioning Sprites 2D

Discussion in '2D' started by Aislin, Jun 17, 2014.

  1. Aislin

    Aislin

    Joined:
    Feb 22, 2014
    Posts:
    17
    Hey All! I'm sure this is a pretty basic question, but what's the best way to place sprites in Editor Mode when position needs to be very precise?

    I have a rectangular shape as the background and I want to create 3 rows of 10 squares going from left to right. I would like the squares spread evenly apart from each other both horizontally and vertically to make it balanced.

    The Transform Position numbers don't seem to relate to anything I can use for positioning purposes, so I don't know how to find out what XYZ coordinates I'd use to place the squares in their exact position. If I knew what the width and height of the rectangular background as well as the individual squares in units of the XYZ coordinates, then I could just use math to figure out the spacing of everything, but there doesn't seem to be any way to get that information.

    Any ideas on how to accomplish this?
     
  2. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    Transform positions are in Unity units. Sprites have a pixels-to-Unity-units conversion - by default this is 100, but you can set it to whatever you like.
     
  3. Aislin

    Aislin

    Joined:
    Feb 22, 2014
    Posts:
    17
    Awesome thanks so much! Got it figured out :)