Problems with storing a screenshot to a folder

Hi i use this code , and its not sending the screenshot to location i provided and giving me an error failed to store a screenshot,
when it was Application.CaptureScreenshot(filename); it was working but not sending ss where i want

public void ScreenShot()
    {
     
        Debug.Log("SS");
        nameFile = imie + nazwisko + klasa + System.DateTime.Now.ToString("_yyyy-MM-dd");
      
        Application.CaptureScreenshot("C:/Users/Screenshot.png");
    }

Did you work out why? same issue

Use ScreenCapture.CaptureScreenshot instead of obsolete Application.CaptureScreenshot, an let’s see if problem gets solved :smile: