I’m following a tutorial and when i make a script, it says No Monobehaviour scripts in file. How can I fix this.
How to report problems correctly in the Unity3D forums:
bump
You didn’t get an answer because you didn’t provide enough information, as Kurt said.
Post your code.
Look in the Console window and copy and paste any error messages you see there.
Without those we cannot possibly help you
The no monobehaviour scripts in file error is commonly caused by a code error in one of your scripts. Unity has to complete a compile of your scripts before they can be added to GameObjects as components, and all compile errors must be resolved before a compile can complete. That means all of your scripts, not just this specific script - all compile errors in all scripts must be fixed. Unity will include all compile errors encountered in the Console window.
Ok here you go.
i make a new one so normal code.
Win32Exception: ApplicationName=‘C:\Program Files\Unity\Editor\Data\Tools\RoslynScripts\unity_csc.bat’, CommandLine=‘/noconfig @ /UnityTempFile-8b8d9879bb78f3f448da971448cc1dba’, CurrentDirectory=‘’, Native error= Access is denied.
System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at :0)
System.Diagnostics.Process.Start () (at :0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
UnityEditor.Utils.Program.Start () (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
UnityEditor.Scripting.Compilers.MicrosoftCSharpCompiler.StartCompiler () (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
Wow, that sounds like a bad installation of Unity. Perhaps go over to the Editor forum and ask about that one. It almost certainly has nothing to do with scripts, except that until you fix it, you won’t be compiling any.
I also have the same problem from a fresh installation of Unity 2019 (also, fresh install of Windows 10 1909).
So far, this has only happened when I import a package (from Unity Asset Store and as .unitypackage file)
This doesn’t happen on a newly-created project so I suspect it’s got something to do with importing packages.