0
    void Update(){
    StreamWriter writer = new StreamWriter(Application.dataPath + @"/SaveFiles/ControlStick.txt", true);
    writer.WriteLine(inputVector); //+ "," + DateTime.Now.TimeOfDay);
}

This is the relevant code. I need to write to a unity file without overwriting the lines again and again.

This is my specific error. IOException: Sharing violation on path G:\Physics Platformer\Assets\SaveFiles\ControlStick.txt System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:320) System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamWriter.cs:124) System.IO.StreamWriter..ctor (System.String path, Boolean append) (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool) VirtualJoystick.Update () (at Assets/UBX-master/UBX-master/VirtualJoystick.cs:51) To explain, i use Application.dataPath to get the installation path of my unity game when it has been exported and installed. Input vector is a Vector3.

Gaming Gecko
  • 49
  • 1
  • 7

0 Answers0