Search Unity

"File not found" when playing on the device, working fine in Unity

Discussion in 'VR' started by jptsetung, Oct 6, 2017.

  1. jptsetung

    jptsetung

    Joined:
    Jan 12, 2013
    Posts:
    51
    I have a file filePath = "Assets/Resources/Images/frame0.png.bytes"

    When I test this : if (File.Exists(filePath))

    On the unity editor it's OK, the file exists

    But when I compile the app on device, the file doesn't exist

    Any ideas ?
     
  2. jptsetung

    jptsetung

    Joined:
    Jan 12, 2013
    Posts:
    51
    My error was to use File which must be platform depend. So I used Resources.Load instead, and it seems to work now.