Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Create with Code Tutorial - Open Script Permission Error on Mac Monterey

Discussion in 'Community Learning & Teaching' started by BellumGalactica, Nov 4, 2022.

  1. BellumGalactica


    Nov 4, 2022
    Hello, brand new Unity user here just getting started on the tutorials. This appears to be the place to post this problem -- if not, someone please point me to the correct place.

    I have just installed Unity/Visual Studio on my new mac running Monterey. I have started working my way step-by-step through the Create with Code tutorial, following the instructions EXACTLY. Things were going perfectly until I reached Lesson 1.2 Pedal to the Metal. I could create my first C# script just fine but I could not edit it, and when I double-clicked on the script I received the following error:

    "The document "PlayerController.cs" could not be opened. You don't have permission. To view or change permissions, select the item in the Finder and choose File > Get Info."

    I have goggled extensively but have not been able to find a solution to this problem. At this point it appears that the tutorial is completely broken and I can not use scripts at all or continue any progress what-so-ever. I am using a brand new Mac running Monterey. The suggested LTS version of Unity (2021.3.12f1) is installed, as is Visual Studio.

    I have today off and had scheduled the entire day to work through the Unity Learn courses, but I have been immediately halted by these broken tutorial instructions. My computer is brand new yesterday, all the software is brand new and the most up-to-date, and I have followed the tutorial instructions to the T. There is no justifiable reason why this should be broken, other than that the instructions given are broken. What a disappointing waste of time.

    Can someone from Unity please provide an explanation and fix for this problem, and please update your tutorial, as I worry all new mac users may encounter this same problem.

    Attached Files:

    MACDUFF1 likes this.
  2. DrWarmind


    Nov 23, 2022
    I am no employee of Unity but I can help you. So your problem is, is that you can't open the script. First, go to Finder, and search for the script. double click on it, and it will show you some options. Search the options for a Get Info. once you found it, click on it. It will open a new small tab and you need to scroll down. Scroll down until you reach Sharing & Permissions. Unlock it and make everything read & write. Then scroll back to the top, there should be an option where you can choose how you want to open the script. It would either be connected to a text editor or if your computer has already set it to visual studios then you are good, if not then click on it and change it to visual studio. You are still not done because now you may be able to open the script but what you write in Visual studios will not be transported to Unity. The cause of this problem is the MonoBehaviour. To fix it you need to go to Unity, open the game you are working on, go to the top left of your screen, and on the right of the apple logo, there is a button called Unity. Click it, once done so, you will have a lot of options, look for the one that says preferences. Once you have clicked it, Unity will open a new tab for you, scroll down until you see external tools, click on external tools, and at the very top of the external tools section, it will say editor script tool, change it to whatever it is already set, to visual studios. Now when you open the visual studio code for your game, MonoBehaviour should have changed color from white to either green or blue, depending on the version.
    onachee, MACDUFF1 and karolinakom like this.


    Jun 29, 2023
    This was exactly my problem and your solution was so clear and perfect! :)