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. Dismiss Notice

C# Opening Problems

Discussion in 'Scripting' started by Maybe_Deus_Plays, Jul 26, 2018.

  1. Maybe_Deus_Plays

    Maybe_Deus_Plays

    Joined:
    Jul 26, 2018
    Posts:
    5
    I don't have much experience with Unity or coding and I decided today I would watch some of the tutorials and YouTube videos on how to use it. I got some of the basics down, and after taking a little break I went back on and it wouldn't let me open my player controlling script. The script was just a couple of if else statements and translations so I deleted it and made a new script and it still wouldn't let me open the script editor. I even reinstalled Unity and it still doesn't work. Does anyone know what I can do to fix it?
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    You could try to make sure the External (code) editor is set properly. This should be the case when you get it, though. I usually open Unity first, then double click a script to open it inside my IDE (visual studio).

    Do you have visual studio + visual studio tools for unity installed, as well?
    That's not the only setup that works, and also depends on the version of Unity.. but it's a good combo, imo.
     
    Doug_B likes this.
  3. NeverConvex

    NeverConvex

    Joined:
    Jun 26, 2013
    Posts:
    88
    If you can't get Unity's built-in editor (Monodevelop, I think?) to function properly, you can always just edit code files with something else. You can find where Unity stores them for a project by right-clicking an asset and opening it in the File Explorer, and then you can edit your code with Notepad++ or whatever other editor you know functions properly.

    This is how I do most of my Unity work, because I don't really like Monodevelop (find it buggy and unnecessarily heavyweight, & it seemed to be a huge pain to get it to play nice with git). You can either create your files initially in the Unity UI or in the Assets subfolder of your project; in the latter case, it'll be auto-detected when you tab back into Unity.

    (The biggest downside to this is you'd have to shop around quite a bit if you want niceties in your Editor like C# auto-completion and the like. Features like that are one of Monodev's strong points. I personally prefer a low-tech editing environment where I just memorize and google all of the classes and method calls I regularly use, though...)
     
  4. Maybe_Deus_Plays

    Maybe_Deus_Plays

    Joined:
    Jul 26, 2018
    Posts:
    5
    I don't have Visual Studio and Visual Studio Tools how do I get it?
     
  5. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    Download the free Community edition from this link. As methos5k mentioned above, select the Unity component during the installation (you can always select it for install later if you initially forget). It is a very powerful IDE and the integrated debugger is a very useful tool to become familiar with as well. :)
     
    Maybe_Deus_Plays likes this.