I tried using Directory class from UnityEngine.Windows and it works flawlessly in editor, but when i tried making a build to test how it will work on a full project it suddenly stopped working.
Here is the code where I’m testing where the roamingFolder method will lead me:
using TMPro;
using UnityEngine;
using UnityEngine.Windows;
public class TEST : MonoBehaviour
{
public GameObject ggg;
TextMeshProUGUI textMeshPro;
void Start()
{
textMeshPro = ggg.GetComponent<TextMeshProUGUI>();
textMeshPro.text = Directory.roamingFolder;
}
}
And as i said in the editor the text changes to what it had to be*.
*checking in the documentation here(Unity - Scripting API: Windows.Directory.roamingFolder)
But, when i tried to make a build of a program with that file i get an error:
![]()
I tried different ways to combat this error, but it just changes to another one of the same variety.
How to fix it? I don’t think i can fix it myself.