- Home /
Visual Studio not autocompleting methods from monobehaviour
My auto completing is completely working with everything except overriding methods from MonoBehaviour such as Update, Start etc. When I want to call the method from MonoBehaviour it autocompletes, but when I want to implement a method like Update, I have to write it out by hand. I know it's a bug because I used to be able to do it before but now I can't.
Did you install "Game development with Unity" when you installed Visual Studio, if you haven't go to the installer -> click $$anonymous$$odify -> and check "Game dev with Unity" -> Accept and wait to install.
Is it for all of your classes, or just one? Sometimes Unity fails to add new classes to your project, and when that happens, only functions and variables defined within that new class will autocomplete. You can fix it by closing and reopening Visual Studio, or by manually adding the new script to your project in Visual Studio. To do that, in the VS project browser (that hierarchy that's usually on the right side of the window) right click the folder where your new class is, and select "Add Existing". Browse to your new file and add it.
I have this problem Too! as far as i remember, VS 2017 was ok and this problem comes with VS 2019 or maybe i'm wrong! but it is very annoying to type for example OnDestroy with correct casing.
Well, first of all the $$anonymous$$onoDevelop methods like Update, Start, .... are not overridable methods and therefore won't show up in any normal intelli sens autocompletion. Those are called based on the name of the method through reflection by the engine. You have to have the Unity development tools plugin installed in your Visual Studio. Those provide autocomplete for the "Unity $$anonymous$$essages". This feature can be turned on / off in the settings menu of Visual Studio under the category "Tools for Unity".
Note I don't have VS 2019 but I'm pretty sure there are Unity tools for 2019 as well. You can check if they are installed by clicking "Tools" -> "Get Tools and Features" inside Visual Studio. This brings up the Visual Studio installer. Under workload you should see the Unity tools already installed. If not, install them. It should be named something like "Game development with Unity". $$anonymous$$y installer is in german, so I can't say what it's called in english ^^.
If there are no Unity tools available, you don't get autocomplete for those messages in VS 2019. You might need to wait until they provide them or just use VS2017. I still use 2017 for almost everything.
Answer by goutham12 · Dec 03, 2019 at 02:12 PM
1) right click on any script or folder and select open c# project. 2) duble click on sln file (it will be like projectname.sln) 3) that will open visual studio, drag your script into visual studio.
if this is not works for try reinstall unity.