Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Trying to take a "high resolution screenshot"

Discussion in 'Editor & General Support' started by Ethan_dale, Jul 12, 2019.

  1. Ethan_dale

    Ethan_dale

    Joined:
    Feb 14, 2018
    Posts:
    10
    I'm coming over from Unreal, and I was curious if there was a way to take a "high resolution screenshot" in Unity. I asked on a Discord channel, and they linked me a bunch of script lines. I don't know anything about coding, though I could probably type out the code in Visual Studio and save it as a .cs file (I think?). I don't know how I would use that in Unity though or anything. I was hoping somebody could walk me through the steps, as a super beginner to Unity and coding in general.
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Unity doesn't have a screenshot button or anything like that, but you can request a screenshot with a simple line of code.

    For unity 2018 and earlier use
    Application.CaptureScreenshot(string fileName, int scaleValue)

    For unity 2019 and later use
    ScreenCapture.CaptureScreenshot(string fileName, int scaleValue)


    If you use a "scale value" of 1, your screenshot will be normal size. A "scale value" of 2 will be double size, etc.


    If you can do basic scripting, you're probably all set now. If you don't know how to script and you just want an easy solution for screenshots, here's what you do:
    - Make an empty GameObject in the scene and select it
    - In the inspector, click "Add Component", click "New Script", then name the script
    - Double-click the script to open it

    In the script, you will see an empty "Update()" function, which looks like this:

    Code (CSharp):
    1. // Update is called once per frame
    2. void Update()
    3. {
    4.  
    5. }
    Just replace that with this:

    Code (CSharp):
    1. // Update is called once per frame
    2. void Update()
    3. {
    4.     if (Input.GetKeyDown(KeyCode.Space))
    5.     {
    6.         Application.CaptureScreenshot("filename", 2);
    7.     }
    8. }
    If you are using Unity 2019 or later, replace "Application" with "ScreenCapture".
    Replace "filename" with your filename (still use "quotes").
    Replace 2 with larger numbers for higher-res images, if wanted. (2 is double-size).

    After that, save the script and run the game by clicking the Play button (triangle) in the middle-top of unity, then press Spacebar to take a screenshot of your Game Window in unity.
     
    Gametyme, c8theino and Naver78 like this.
  3. Sanvean3

    Sanvean3

    Joined:
    Jul 27, 2015
    Posts:
    1
    Just wanted to say thanks, this was helpful!
    The screenshot appears in the general folder of your game project.
     
    Naver78 likes this.
  4. yusuf_isik

    yusuf_isik

    Joined:
    Feb 14, 2014
    Posts:
    24
    ddreams_anne, c8theino and Naver78 like this.
  5. MikeBastien

    MikeBastien

    Joined:
    Apr 24, 2009
    Posts:
    139
  6. Naver78

    Naver78

    Joined:
    Oct 26, 2020
    Posts:
    4
    heey I use the new one but couldn't find the screenshots anywhere. Anyway here is something that helps.

    assetstore.unity.com/packages/tools/utilities/screenshot-companion-67779
     
  7. ju_my

    ju_my

    Joined:
    Mar 7, 2017
    Posts:
    23
    The upscaling is useless, it can't record a screenshot at higher resolution that the camera . I record my screenshot at scale 10 and my image is nothing different than the 1x !