How do I create a text file in unity?

Hi, I wondering how I can create a text file in unity. This text file is .txt. I want to write something in the text through the c# script. and then I want to read the text file. I’m looking for this http://www.cplusplus.com/doc/tutorial/files/ , but in unity / c#. I’m trying to do a high score list where i put all the information in a text file. And I just wondering if you could help me find a way to create a text file. Because I work on mac and pc. but the problem is that mac have their own text format file. their name isn’t .txt. it is something like .rtf. Thanks for taking your time. :slight_smile: and have a good evening.

Hi.

Use File.WriteAllText and File.ReadAllText.

Thanks.

1 Like