Search Unity

Help configuring PPU

Discussion in '2D' started by FirstAndTen, Oct 16, 2017.

  1. FirstAndTen

    FirstAndTen

    Joined:
    Oct 16, 2017
    Posts:
    16
    Hi everyone,

    I am currently porting my game from Monogame to Unity. My 2D game is a sports game and the field has been created so that 16 pixels = 1 yard. I manually place the players on the field a lot and I use that ratio to determine the distance to place players from one another (and for other calculations like distance to kick the ball, etc). For example, in Monogame, if Player B needs to be 5 yards behind Player A I get the vector of Player A, then add an offset vector of (0, 80, 0) to it, then set Player B's position equal to that sum in order to place him 5 "yards" behind Player A. This works out of the box in Monogame, in Unity the vector's are "off". A vector of (0, 3, 0) is 100+ pixels difference.

    The character sprites are 16w x 32h in the game and I set the PPU for the field background and the player sprites to 32. 16 PPU is too zoomed in for the camera when the game runs and 1 PPU is WAY too zoomed in.

    I'm assuming to get back to the vector accuracy of Monogame where 1 point = 1 pixel I need to set the PPU of the sprites to 1 PPU.

    1. Is this correct logic?
    2. Is setting the size value of the Main Camera the correct way to resolve the zooming issue?

    Hope this makes sense.

    Thanks.
     
    Last edited: Oct 16, 2017