I’ve been following the class so far without issues, however for whatever reason when typing OnTriggerEnter2D it doesn’t pop up the autocomplete options. If I continue the command manually it never highlights it blue.
Am I missing something? I do want to point out that all the code is working as expected. The ball dropping off the screen causes the game to proceed to the “Game Over” scene.
If you look on the right-hand side (default location) for the Solution Explorer, is the solution and project loaded? If you only had the file open and not the project Visual Studio wouldn’t have loaded all of the .dlls/libraries required to support Intellisense. That said, the MonoBehaviour inherit might underline also at that point.
Some other things to try/consider;
save the script / close / re-open Visual Studio
check that Visual Studio is up to date, yellow notification flags appear at the top if there are updates to install
Versions of both Unity and Visual Studio could be useful here also.
Could you zip your project files up and share them with me so I can test this end?
The forum will allow uploads of up to 10MB, if your project files (zipped) are larger than that you would need to use a service such as Google Drive or Dropbox, and then share the URL.
Just out of interest Andrew, what if you create a new project, literally empty, but then create a new script and add the OnTriggerEnter2D method, does it do the same?
If you expand the References in the Solution Explorer on the right-hand-side of Visual Studio, if you scroll through, do you see several that mention Unity in that list?
Assuming you have Intellisense enabled within Visual Studio;
…the only reason I can think of as to why this would be happening would be because Visual Studio isn’t able to reference the required libraries. If they are shown within the References under Solution Explorer.
As mentioned before, there was a recent version of Visual Studio and the Visual Studio 2017 Tools for Unity which had an issue and were not correctly re-loading projects, this would mean that a script was opened on it’s own effectively, without the reference to the project and thus, without the reference to the Unity libraries under Resources - this would cause the behaviour you are describing.
Assuming you have no updates due to install for Visual Studio, Intellisense is enabled and those library references are displayed I cannot think of any other reason why this wouldn’t be working for you.
The only thing I could suggest really at this point would be to uninstall Unity and Visual Studio (thoroughly), the reinstall Unity, ensure Visual Studio 2017 Community Edition is enabled as a component to install and see if after a re-install things are any better.
I looked at the ideas in your last post and ever thing looks like it should and still the same problem. Reinstall did not change it. It doesn’t recognize/autocomplete any methods names - not even Start and Update - although it does recognize all other parts of the first line in the method such as private, public, void and types used to define the arguments like int or Collider2D.
Do you have access to another computer that you could install both Unity and Visual Studio upon and then open the project on that? It would be beneficial to try to isolate the issue.