How do I save coordinates to a text file?
I'm in the making of a simple tower 2D defense game, for this I need to make waypoints for the enemies to follow. I already made it so I can save my maps (different gras types) to a text file, but how do I save different coordinates to a save file while keeping the order?
My maps are based on a grid, so I need to store coordinates like 3,4-6,7-8,9.
How do I store/read them the best way?
PS I do it in C#
Answer by RobAnthem · Dec 28, 2016 at 11:23 AM
Using simply a binary formatter. You can read up on it here Binary Formatting
Thanks I think that's going to work, but how is the file going to look, because I would like to make them manually. I think it's going to be unreadable for humans. Do you have any suggestions?
Then don't use a binary formatter. Just Search and read about how to read/write a normal text file in Unity.
Answer by UnityCoach · Dec 28, 2016 at 07:11 PM
You can use XML, here's how to do it or make your own parser, using System.IO
Your answer
![](https://koobas.hobune.stream/wayback/20220612103605im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Save Blendshape values 0 Answers
Error writting a file 1 Answer
Intercepting planet in orbit on a straight path? 0 Answers
Serialize gameobject children behaviours 0 Answers
Saving Game Data to iOS Device 1 Answer