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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to set size in Unity? Newbie question

Discussion in 'General Graphics' started by Botilada, Apr 26, 2019.

  1. Botilada

    Botilada

    Joined:
    Apr 25, 2019
    Posts:
    8
    Super newbie question: All png assets get the "size", i.e. scale, 1 "unity-unit". To begin with they have a size in pixels, how does this correspond to the unity-unit. Is scale only what it says so that 1 is 100 % of it is original size and any changes made will only scale it relative to it's original size. If so, how do I change the size of a game object in absolut measures?
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,365
    imported PNGs don't have a "size" in Unity as far as I know (except maybe pixels-per-unit if it's a sprite). Are you actually referring to a quad that has a png as it's texture?
     
  3. Botilada

    Botilada

    Joined:
    Apr 25, 2019
    Posts:
    8
    Thanks! That was my guess.

    Here is some background: I have a memory game as an app created in Adobes Flash/Animate. Now I want to migrate the whole project to Unity. I need to decide what size in pixels to export the cards with. In many cases (like on the web, print etc) it is better to create a larger image and make it smaller on the destination. But when I try it in Unity the image with 0.5 in scale looks ugly. Exporting it with half the original pixels from Animate looks good. But then I need to know what exact size I want the cards to be before exporting them and never changing the size of them in Unity in the future. My guess is I am missing some smart settings in Unity here...? What is a good workflow for art work (not pixel art)?

    Ps. It is not a quad with texture. It is 2d and I guess it should then be a sprite...?
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,365
    That's generally how you would do it in unity too. Not sure why it's not working for you, though. Can you describe how you are doing this?
     
  5. Botilada

    Botilada

    Joined:
    Apr 25, 2019
    Posts:
    8
    Hi, now I've found a youtube tutorial describing a card game.
    And based on that input I guess a card game is best created with ui elements, not with 2d elements. Would this be the right path for cards? When I do it this way I have access to the pixel-height and pixel-width. The cards are then ui images.

    I also guess a key to understanding how to do, is world space and screen space. https://gamedev.stackexchange.com/questions/143348/screen-space-vs-world-space-canvas

    At the moment I am doing Unitys Ruby tutorial and am confused by the easy going attitude to pixels, like when the tile is to small for the unit they only change the sprite (tile) from 100 to 64 pixels per unit. Wouldn't that make it blurry? So I still think I am missing some interesting clue about Unity...?

    My big confusion is how do I control the number of pixels displayed on a screen, i.e. how can a see what is happening and how can I plan my project. But I can't find any tutorials for how to deal with pixels, units and measurements, like best practice for how to plan for a project. Most tutorials only takes care of one aspect (one type of game at the time), not the general way of thinking. So I'd appreciate link tips. :)