Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Saving/Loading text file works on Windows/Mac but not Linux

Discussion in 'Linux' started by charlesaverill20, Jun 17, 2020.

  1. charlesaverill20


    Jan 24, 2019
    I have an Overworld scene and a Battle scene. The overworld scene generates the encountered monsters when a random encounter occurs, and saves that prefab's filepath to a text file. Using Resources.Load, I read from that text file to load the monster prefabs. This works perfectly on Mac and Windows, but when I run it in the Linux standalone, I get this error:

    Code (CSharp):
    1. DirectoryNotFoundException: Could not find a part of the path "Assets/Resources/encounter.txt".
    2.   at System.IO.File.Delete (System.String path) [0x00058] in <c79628fadf574d3a8feae0871fad28ef>:0
    3.   at RandomEncounterHandler+<initiate_encounter>d__8.MoveNext () [0x0004b] in <74fe8a918ef24f5894f6a9f5c05a8427>:0
    4.   at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <178ddd31bba24519b6902f51d097c6f3>:0
    5. UnityEngine.MonoBehaviour:StartCoroutineManaged2(IEnumerator)
    6. UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    7. RandomEncounterHandler:Update()
    Anyone know why this is happening? I figure it's because the Linux standalone has a different file structure than the Windows and Mac standalones, but I'm not really sure.