hmm, mine differs a little, but not massively. I still don't see why it wouldn't work. You're doing things in a slightly more smart way, replacing all the blank spaces. This is my exact implementation
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; public class Level10 : MonoBehaviour { public MovingPlatform movingPlatform; string normalPath; string normalPath2; public MovingPlatform bug; string bugPath; string bugPath2; void Start() { normalPath = Path.GetFullPath(Application.dataPath + @"\platformsettings.txt"); normalPath2 = normalPath.Replace(@"\ThatGame_Data",""); bugPath = Path.GetFullPath(Application.dataPath + @"\bugsettings.txt"); bugPath2 = bugPath.Replace(@"\ThatGame_Data",""); } void Update() { if (!movingPlatform.forceMove) { if (File.Exists(normalPath)) { if (ReadString(normalPath)) { movingPlatform.forceMove = true; } } if (File.Exists(normalPath2)) { if (ReadString(normalPath2)) { movingPlatform.forceMove = true; } } } if (PlayerPrefs.GetInt(gameObject.transform.parent.name) != 1) { if (File.Exists(bugPath)) { if (ReadString(bugPath)) { bug.forceMove = true; } } if (File.Exists(bugPath2)) { if (ReadString(bugPath2)) { bug.forceMove = true; } } } } public bool ReadString(string path) { StreamReader reader = new StreamReader(path); if ( Read(path, reader, "moving = true") || Read(path, reader, "moving= true") || Read(path, reader, "moving =true") || Read(path, reader, "moving=true")) { reader.Close(); return true; } else { reader.Close(); return false; } } public bool Read(string path, StreamReader reader, string check) { reader = new StreamReader(path); if (reader.ReadToEnd().Contains(check)) { reader.Close(); return true; } else { reader.Close(); return false; } } }
I'm a little confused, not really sure what to suggest... I'll have a think but seems my brain isn't working this evening 😅Sorry about the blocked progress in the game!
Also thanks again for doing that :)