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

Application.CaptureScreenshot how to delete an screenshot from a path.

Discussion in 'Scripting' started by Conflei, Aug 4, 2014.

  1. Conflei

    Conflei

    Joined:
    Apr 21, 2013
    Posts:
    44
    Hello everyone, i'm making a game and i'm taking a screenshot with application.capturescreenshot but after a while i want to delete this and i'm still having the path of it, any helps?
     
  2. Conflei

    Conflei

    Joined:
    Apr 21, 2013
    Posts:
    44
    Already tried using System.IO.File.Delete(path) or System.IO.File.Delete("/private"+path)
     
  3. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    Where did you save your screenshot? It is usually saved at Application.persistentDataPath. If that's the case, you can use System.IO.File.Delete(Application.persistentDataPath + filename) .
     
  4. Conflei

    Conflei

    Joined:
    Apr 21, 2013
    Posts:
    44
    thanks but not working...
    I'm on IOS, so i read in a post that i need to use System.IO.File.Delete("/private"+Application.persistentDataPath + filename) but is not working neither.