Screenshot multiple

Does anyone know how I can screenshot different scenes in the mobile phone.? I got this script but it only allow MAXIMUM OF ONE SCREENSHOT only, so everytime I tried to perform the screenshot it doesn’t save anymore :frowning:

void OnGUI() {
    if (GUI.Button (new Rect(50,50,150,30), "Capture")) {
        string filename = "shot.png";
        Application.CaptureScreenshot(filename);
 
        if (QCARRuntimeUtilities.IsPlayMode()) {
            // if in PlayMode, the screenshot will be saved
            // to the project directory
            Debug.Log ("Saved screenshot to " + filename);
        }
        else {
            // if running on Device, the screenshot will be saved
            // to the Application.persistentDataPath directory
            Debug.Log ("Saved screenshot to " + Application.persistentDataPath + "/" + filename);
        }
    }
}

Actually it allows multiple screen shots, but since you are always using the same file name, the last one taken is the only one you see. Try creating a unique file name each time it is called:

string filename = "shot"+Time.frameCount+"png";  

Note is a solution for a single session. You’ll have to come up with something else if this is for an end user or if you want to have it for multiple sessions. You could keep a shot count using PlayerPrefs and use that for example.