• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Bynar1M4n · Oct 09, 2018 at 03:13 PM · 2dspriteimagescalepixels

doubt with pixels per unit

Hi. I have a question about pixels per unit (ppu). I understand that means that for each unity unit they fit x pixels (100 by default). Is it recommended to edit the ppu value of each image so that it fits in the game? For example: I have two images of 1920x1080, a dog and a house, can you put a ppu of 64 for the dog and 512 for the house or should you play with the scales of the transform? Thanks.

Comment

People who like this

0 Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hexagonius · Oct 09, 2018 at 03:55 PM 0
Share

usually scaling is to be avoided. the uniform scale of 1 is the best you can work with in terms of childing, physics and such. use the PPU settings as they leave this untouched.

avatar image Cherno · Oct 09, 2018 at 03:58 PM 0
Share

It depends on what your graphics should represent. 1 Unity unit should be roughly 1 meter so the physics work right.

avatar image Bynar1M4n Cherno · Oct 09, 2018 at 04:18 PM 0
Share

So, if i have a big image of a knife i should edit the pixel per units, right?

avatar image Cherno Bynar1M4n · Oct 09, 2018 at 08:29 PM 1
Share

If the knife should be real-sized, then yes.

1 Reply

  • Sort: 
avatar image
Best Answer

Answer by pako · Oct 09, 2018 at 08:12 PM

It seems to me that you are looking at the problem the wrong way around.

What you should have in mind is to get a match between the game world and the size of your textures. IMHO it's much more convenient to have a fixed ppu for a particular target resolution.

It's easier to think about this in a 2D game:

e.g. if your target resolution is 1920x1080, then if you set ppu of all your textures at 100, then this means that one screen width represents 19.2 meters and the screen height will be 10.8 meters in the game world.

So, you will need to size your backgrounds accordingly. Also, in the case of the dog and the house: if you want the dog to be 0.5 meters long, and 0.3 meters tall, you can calculate how many pixels you need to make your texture: 0.5 meters corresponds to 0.5 / 19.2 = 2.6% of the screen width, and 0.3 / 10.8 = 2.8% of the screen height. Since you know the world size of 19.2x10.8 meters correspond to resolution is 1920x1080, then 1920 x 2.6% = 50 pixels, and 1080 x 2.8% = 30 pixels. So, your dog texture should be about 50x30 and it will have a good size in the screen relative to other objects. In practice you will make the dog texture slightly larger in order to add some transparency around the boarder, and you'd also need to account for changes to the dog image due to animation. Similarly, you could calculate the pixel size for the house, etc.

Now, if you wanted to target an additional resolution of say, 960x540, and provide smaller textures for that, it would be easy to adjust the texture sizes of all your objects to 0.5 of what they are for 1920x1080. However, in this case, you would need to adjust the ppu to 50, because you'd then get 960 / 50 = 19.2 meters wide and 540 / 50 = 10.8 meters high, i.e. your game world will be the same size as at a higher resolution. So the dog's texture would be 25x15, but still the same size in the game world.

Now, if instead of having uniform ppu per target resolution for all your objects, you changed the ppu per object in the same target resolution, I think it would be quite hard to size your objects (IMHO).

Comment
Legend_Bacon
Bynar1M4n

People who like this

2 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bynar1M4n · Oct 10, 2018 at 12:58 PM 0
Share

Interesting answer. So i should think the game in the desired resolution and then make the images. In this way, the ppu edition affect all the images in the same time. Makes sense.

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta on June 13. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

204 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Adjust overlay position for different resolutions 0 Answers

How do importing image when game is running (Run Time) ???? 0 Answers

2D game using sprites. 1 Answer

Problems assigning sprite's images 1 Answer

Unity 2d Sprite size 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges