Skip to content

Question about using VS code with Unity

Hi everyone! I just started game dev a couple days ago on unity, and came across a very annoying problem. Whenever I write a c# script on vs code through unity, intellisense doesn’t fully work, like it doesn’t give a red underline to errors or auto fill words like transform. Additionally, I always get this error that pops up on the bottom right that says “some projects have trouble loading”, but all my projects have loaded fine so far.

So far I’ve tried changing the external script editor directly to vs code, regenerated project files, changed target framework version in assembly, and some other things. I’ve already spent hours scouting the internet to find an answer. It’s extremely frustrating and I would greatly appreciate it if someone could help me out with this. Thanks in advance!

2 points8 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
lb7ylb

Author

1
posts
3
comments
0
media
View profile

9 comments

When you first boot up Visual Studio, and up until you get the "trouble loading" error, check your omnisharp output log. What does it say? (Click the little intellisense flame to get to the output log).

1 points
unknown author3 hidden

Deleted before we saved it.

1 points

I kind of wish you'd copied the whole thing. I've had a fair number of Omnisharp problems in the past and if I recall correctly the last time it was because I had 2 separate versions of MSBuild installed simultaneously and VSCode was trying to use the wrong one. I take it you've already tried installing the developer packs - maybe you have an older version installed as well.

1 points

I honestly think I'm just gonna switch to jetbrains rider, bc Im on mac. I think that may be the problem

1 points

I doubt it... I'd check the lines in your output below
OmniSharp.MSBuild.Discovery.MSBuildLocator

1 points

Did you install the Unity tools extension for Visual Studio? It’s not gonna work even with regenerate projects if you don’t have the tools installed in Visual Studio itself, usually it gives you an option

Edit:

it looks like this

1 points

I actually found out the problem before, it’s that apparent my dot net core wasn’t updated. Kinda funny cause I only found that when trying jetbrains as an alternative lol

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.