Search Unity

My [C#] Script Won't Open !!!

Discussion in 'Scripting' started by coduses, Jun 30, 2015.

  1. coduses

    coduses

    Joined:
    Jun 30, 2015
    Posts:
    5
    No matter what I do,My C# script will not open!!! It just displays the loading splash. Plz help!:(:(
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    ... are we really meant to be able to know what you have, and what you have done from that one line?

    how about you give us a little more info to go on? what is your ide of choice (monodevelop or visual studio), how have you created the script? etc.
     
  3. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,528
    If you're using VS, sometimes the .NET version throws a popup box and you have to select it on the taskbar to confirm the choice.
     
  4. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Try using MonoScript or NotePad++
     
  5. coduses

    coduses

    Joined:
    Jun 30, 2015
    Posts:
    5
    I am using MonoScript and created it by creating it in the inspector of my player. I'm a noob 2:D;)
     
  6. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Is it giving you an error? If you used an code you found online you may have the script title wrong.. Like this..

    public class MainMenu : MonoBehaviour

    If your script in your inspector is called Menu.. Yet your script says MainMenu then it wont work.
     
  7. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Post your code that isnt working?
     
  8. Eths

    Eths

    Joined:
    Mar 5, 2015
    Posts:
    184
    He can't open the damn script, how can he post the code , lol
     
  9. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    With such little info provided:

    I'm not sure if he talking about the code editor or launching the game and getting stuck at the loading splash.. So I totally get @shawnrevels questions - the OP is too ambiguous to decide.
     
  10. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Exactly.. I was assuming he had already wrote the script and now he cant re-open it..
     
  11. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    And you can technically open the script in notepad++. I would try using an alternate script reader.
     
  12. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    I assuming he is talking about monoscript splash. screen. Its probably just a glitch.
     
  13. Eths

    Eths

    Joined:
    Mar 5, 2015
    Posts:
    184
  14. coduses

    coduses

    Joined:
    Jun 30, 2015
    Posts:
    5
    It was just created when I couldn't open it.
     

    Attached Files:

  15. coduses

    coduses

    Joined:
    Jun 30, 2015
    Posts:
    5
    It's numero uno: the code editor
     
  16. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Can you open Mono by itself ? - not using unity. Probably Mono hanging not related to Unity.

    Go to the Unity folder in Program Files/Unity, there is a folder - MonoDevelop. Run the mono shortcut in that folder.

    Does it run ok?
     
  17. coduses

    coduses

    Joined:
    Jun 30, 2015
    Posts:
    5
    ty Korno, yea,it does work fine :D
     
  18. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Ok, well if it runs fine leave it running then start unity. When you double click the file it should use the running instance of Mono ... but that is just a work around...
     
  19. eisenpony

    eisenpony

    Joined:
    May 8, 2015
    Posts:
    974
    Happens to me occasionally. Mono Develop throws an error which appears behind the splash screen and the splash screen won't go away until I close the error. Sometimes it is a big dialog and you can see it, other times it is small and you can't see anything but the splash screen. Very annoying.
    error.png context.png

    Here's a few techniques I've used to get around the issue:
    1. Close MonoDevelop and try again.
    2. If the error dialog is large enough, you can grab its title bar and move it somewhere the splash screen is not in the way
    3. If the error dialog is too small, click the MonoDevelop splash screen to select the error dialog, then hold alt and press the space bar. This brings up the Windows context menu. Press the C button to choose close.* Alternatively, the Esc key sometimes works to close the error.
    Hopefully there are not too many error dialogs since you will need to do this for each.
    *For Windows PCs
     
  20. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,727
    Mono chokes all the time like this. Steps to cure:

    1. Go into task manager, kill any extant MonoDevelop.exe tasks
    2. Go into your project root (where Assets and ProjectSettings are) and delete these files: Assembly-CSharp-* (all those files) and pretty much any other file you don't know is yours in that directory (shouldn't really keep anything in there honestly; none of those should be source controlled; Unity rebuilds them).
    3. from Unity, use Assets--> Sync MonoDevelop. Unity will regenerate all the above files and launch Mono

    Edit: to clarify delete-able files in this directory, you can delete files that match these wildcards:

    *.userprefs

    *.sln

    *.csproj

    *.unityproj

    ... because Unity rebuilds them when you open a C# file or do Sync Monodevelop.
     
    Last edited: Jun 30, 2015
  21. xX_big_rod_69_Xxyt

    xX_big_rod_69_Xxyt

    Joined:
    Oct 13, 2020
    Posts:
    1
    He can ss from the inspector tab
     
  22. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    Do yourself a favor and install Visual Studio.
     
  23. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Bad necropost.
     
    Vryken likes this.