- Home /
Project text file not built for Macs
Hi all,
For my game, I have a script reading from a textfile to make decisions/do actions. This text file is located in my game folder. When I build the game to a Mac Application, the textfile is not built along with the rest of the game so that the application cannot run properly. I opened Contents via "Show Package Contents" and tried to paste the file into all of the associated folders in Contents. However, it still isn't being read. Does anyone have suggestions? I tried to attach the .txt to a GameObject, but then I realized that wasn't allowed in Unity...
Note: For the Windows version, the textfile isn't built either but I pasted it next to the executable (in the same folder) and that seemed to solve my problems.
If you text file is static (i.e. you are not trying to update after your game ships), then put the text file into your Assets folder. It will be come a TextAsset and you can use the interface to access the contents.
$$anonymous$$oving it into my Assets folder worked! Thank you!
Is there a way for me to accept your comment as the answer?
Answer by Xtro · Aug 06, 2013 at 03:56 PM
In Mac, App icons are folders. Just right click on it an select "open container" or something. You will see the inner files and folders in it. Try to place your txt file somewhere in there. Possibly the MacOS subfolder.
I tried that and I think something froze the application so I Force Quit out of it. Now, Unity won't let me open the application. I deleted it, restarted my computer, and rebuilt it with a different name but still no luck :( It keeps quitting "unexpectedly" and when I try to reopen, the same problem cycles. Help?
Which app icon did you try it on ? You should put the txt file into your compiled game icon. Not into the Unity's own app icon.
Did you break unity ?
Unity Project and Compiled Game are different places and folders. Even if you break the compiled application(your own) Unity should be able to open the project since you didn't touch the project folder. Right ?
I think I may have broken Unity :/ I don't think it was because I attached the textfile though. It seems like it was because I Force Quit...
Unfortunately still broken, opens:
"The last time you opened Unity it unexpectedly quit,..." and then automatically switches to a window that says: "Unity quit unexpectedly. Click Reopen to open the application again."
When I click Reopen, it goes back to the "The last time you opened Unity it unexpectedly quit" :(
There's a lot in the Problem Details and System Configuration, but I have no idea what any of it means.
Your answer
![](https://koobas.hobune.stream/wayback/20220613111635im_/https://answers.unity.com/themes/thub/images/avi.jpg)