macOS Catalina - Compiled game asks for access to the documents folder

Hi All,

I’ve been learning Unity dev (using v2019.3.15) for about a month or two on and off and I’ve come across a problem on macOS Catalina where the compiled game displays the following (note that the buttons aren’t greyed out, they just appear that way on the screenshot probably due to lost focus on the window):

I know that this is appearing because I’m loading and saving high score data and it appears whether I use PlayerPrefs or Application.persistentDataPath (it doesn’t appear if I comment out the loading and saving code altogether).

I guess its a security thing but its really annoying as I have to grant permission again whenever I test a new build (by running the compiled app).

I’m hoping this is an issue with my Google Kung-Fu as I can’t find anything to point me in the right direction on solving the probem. If anyone could help with any pointers on why it is happening and how I stop it if possible that would be much appreciated.

If more info is needed to help find an answer, please just ask as I’m not sure what’s best to include.

Thanks for your time advance

1 Like

Hi Again All,

I’ve seen that there’s been a load of views but no answers, which is fair enough but does anyone have any advice on how to get an answer?

Have I posted in the wrong section of the forums? I assumed the Mac section would be best but it was my first post so what do I know :wink:

Can / should I be asking Unity directly instead of using the forum?

Any pointers would be very much appreciated!

Hello! After nearly a year of dealing with this problem. I discovered today that having in a script a Void OnGUI() Function will trigger the event. I reccomend you create a script that contains an OnGUI() function and having it in the first scene when you launch the app. Then disable the script. In this way you can always make sure that the popup only comes up at the beginning.

I don’t know if there is another thing that can trigger this, but in my project this was the problem.

Hey Ashanex,

Thanks for letting me know your approach, it’s pretty similar to what I decided to go with.

I’ve ended up displaying the high score table on the game’s intro screen so that the access message is displayed at the beginning rather than when the player has to enter their name at game over.

Not ideal but there doesn’t seem to be a way of stopping it from showing. Guess its just a Mac thing.

Thanks for the help :slight_smile:

1 Like