So the code in our game is setup to check in external folders for and unknown number of images and then convert them to textures and display them on a plane, a next button cycles through the number of files in the given folder.
So the build on the game works perfectly on most systems but a small number of windows machines block the loading of files with WWW, they show the red question mark error texture. This only happens if the game is located in the ‘users’ folder or a sub-folder such as ‘Desktop’, or the ‘program files’ folder etc. I know that the code is looking in the correct folders for the content because it loops through the correct number of files it needs to but it cannot load them.
Has anyone else seen this problem, I have tried disabling windows defender but it does not seem to be the cause.
I have made an installer for the game to install to a particular folder where the files can be read but this is not ideal solution for us, has anyone seen this issue before, it strikes me more as a windows issue than a strictly unity issue.
Thank you if anyone can help, I realise this is a sort of niche problem.
IEnumerator Start()
{
DirectoryInfo module1aobject1 = new DirectoryInfo (Application.dataPath + "/learn/module1aobject1/");
info1 = module1aobject1.GetFiles("*.*");
IEnumerator module1aObject1LoadFiles()
{
//foreach (var t in module1object1)
if (mod1count < info1.Length)
{
doneButton.SetActive (false);
Texture2D tex;
tex = new Texture2D (4, 4, TextureFormat.DXT1, false);
using (WWW www = new WWW (info1[mod1count].FullName))
{
yield return www;
www.LoadImageIntoTexture (tex);
GetComponent<Renderer> ().material.mainTexture = tex;
}
mod1count++;
}
else if (mod1count >= info1.Length)
{
doneButton.SetActive (false);
userPhone.SetActive (false);
dynamicPlane.SetActive (false);
dynamicButton1.SetActive (false);
mod1count = 0;
}
}