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

Resolution Difference Between Game and Scene

Discussion in '2D' started by VFranklin, Sep 17, 2019.

  1. VFranklin

    VFranklin

    Joined:
    Jul 26, 2017
    Posts:
    48
    Hi,

    I loaded several sprites into my game scene and they're nice and crisp! But when I play the game they are very blurry. I also notice the supposed position of sprites in the scene view is completely different form the position in the game view.
    Why is this and how can I fix the sprite resolution in the game?

    Thank you.
     
  2. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    556
    We really need screenshots and your camera settings to determine the cause and how to help you.
     
  3. VFranklin

    VFranklin

    Joined:
    Jul 26, 2017
    Posts:
    48
    Here's a pic. The scene view and game view are really different... For the resolution, I'm starting to think I rescaled the sprites to be too small. It was 100x100 before and now much smaller. Maybe that's it?
    Thanks
     

    Attached Files:

  4. VFranklin

    VFranklin

    Joined:
    Jul 26, 2017
    Posts:
    48
    This image also shows the res difference. Also, I set a box collider 2d for the platform in the middle but the player floats way above it. The player also has a circle collider exactly around it.
     

    Attached Files:

  5. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    Try the following: At the top of the Game View window, reset the zoom slider to 1x. Place one of your sprites of which you know an approximate real world scale into the Scene View. Ensure its position is at 0,0,0 and scale at 1,1,1. Now place a default 3D cube at the same position. This cube is 1 unit aka 1 meter in the real world. Now you want to ensure that your sprite is correctly sized in relation to that unit cube. For example, a player character should be roughly 2 units tall. Three variables influence the final size: number of pixels in the actual image texture (your png etc), the points per unit setting in the sprite asset importer and finally the scale of the transform. Start with pixels. You need enough to fill the area on the output screen. If your player is small (10%) of the screen height on full HD, the sprite only needs roughly 100px, but lets draw it at the next larger power of two resolution (128px or 256px). If the sprite covers the entire screen you maybe want 1024px. Now set the points per unit value on the sprite asset importer to 128 for a 256px player sprite. This will make the sprite twice as big in the scene. Leave the transform scale at 1 unless you need differently scaled sprites for a single texture. Lastly, adjust the camera. ;)
     
    Last edited: Sep 22, 2019
    VFranklin likes this.
  6. VFranklin

    VFranklin

    Joined:
    Jul 26, 2017
    Posts:
    48
    That works great, thanks!