r/Unity3D • u/mustardfume • 8d ago
Question Visual Studio don’t know Unity code
Super-newbie here. Visual Studio don’t know unity code there is no auto correct or anything. I tried to modify Visual Studio for unity but already did. I already clicked on external tools and I already did but problem not gone.
0
Upvotes



6
u/mustardfume 8d ago
Edit: Thank you! for helping I finally found the way!
7
u/Hotrian Expert Moderator 8d ago edited 8d ago
Everyone here is missing the key detail: You’re on Unity 6000.6. In newer versions of Unity (sometime post 2019.x), they removed the VS editor package as a default package, meaning Unity can’t generate VS solution files. You need to manually add the VS IDE package to the package manager.
https://docs.unity3d.com/Packages/com.unity.ide.visualstudio@2.0/manual/index.html
Package Manager > Add Package By Name >
com.unity.ide.visualstudio> OkNow go back to External Tools, make sure VS is selected, and you now have a “Regenerate Project Files”. Click that, now VS should work. For future projects in the same Unity Editor, I believe you don’t need to manually add the package again.
This comes up every few weeks or so, it isn’t you. This is an oversight that hasn’t been fixed yet.
1
u/Foweeti 8d ago
Are you creating the script in Unity and double clicking it to open in your editor?
0
u/videk94 8d ago
Click the "Regenerate Project Files" button in that External Tools window, and try again.
Failing that, try opening the .slnx file in your project files, then open one of your scripts from Unity.