Nobody ever told me visual studio and visual studio code were different! Thanks. After 2 days of research, I found such a good vid and I'm finally able to do something. Definitely gonna leave a like. 😄
OR ANYONE STARTING UNITY IN 2022, PLEASE DO THIS BEFORE WRITING ANY SCRIPTS: Unity and Visual Studio will sometimes have a compatibility issue where something called Intellisense does not work. Intellisense is your code completion, and much more. It should be fixed immediately. Step 1: Close Visual Studio Step 2: In Unity, go to Edit < Preferences < External Tools (left part of the Window) Step 3: In External Tools go to the part that says External Script Editor (this should be on which ever Visual Studio editor you are using (for me it defaulted to "Open by File Extension" Step 4: Make sure Generate all csproj files are checked, and Editor Attaching is checked Step 5: Open the C# script you were trying to open earlier. I copied it from mEmEMan as i was facing this problem
Thank you SO MUCH! I watched a game tutorial video and they skipped how to connect Unity with the coding program and stuff. Stuck there for a while until I found your video 😅
Wow, this video saved me. What you didn't in the video didn't exactly help me but when you mentioned that omnisharp should have good logs, I checked it out and found out that my dotnet version was outdated and I needed to update it. Once I updated dotnet, I restarted vscode and regenerated the project and everything worked again!
You are an incredible human. This video was so clear and concise. Visual Studio Code is finally working how it was meant to and I'm so excited. Thank you :)
Thanks for this helpful intro! for all the user that are seeing this video a year later like me ;) the new package has a blue icon and it does not say powered by omnisharp, however it works the exact same way as shown here. this is the same extension as show in the video: ms-dotnettools.csharp below the title C# Base language support for C# by microsoft, right now its v1.26.0 and in unity the package also has one .5 1 version higher :=)
glad you posted this, tried swapping to VS Code a while back but could never get the SDK to download, had the same problem today but realized my brave browser is just broken as hell when it comes to that website in particular. switched to windows explorer for 2 seconds and it downloaded no problem. wonderful knowing that i can get it to work I always wanted an upgrade to my text editor. visual studio is fine and everything but man it is kinda frustrating to see a difference in the colors of your text and visual studios. being that you posted this to help people switch over is amazing.
It's showing me "Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)" any idea how to fix this? I've tried looking on StackOverflow to no avail.
If you are still having problems, download the .NET Framework 4.7.1 Developer Pack, as this specific targeting framework is used by many versions of Unity: dotnet.microsoft.com/en-us/download/dotnet-framework/net471 A recent update to the C# Omnisharp extension in VS Code required me to download .NET 6 (or newer) in order for my projects to load correctly in VS Code. The download page is here: dotnet.microsoft.com/en-us/download/dotnet You may also need to restart your Windows computer to allow system environment variables to update. If all else fails, follow these steps: code.visualstudio.com/docs/other/unity#_prerequisites
@@supernovatluthelightoftheu3221 I have read that a new update means that a critical package (MSBuild) for the C#(OmniSharp) extension is no longer installed alongside. I had to actually go install Visual Studio and choose the .NET Framework package during installation in order for VSCode to work. Very weird and convoluted installation process but it worked for me.
Loved the tutorial. It's very concise. I'm dealing with an issue on my end though. I was hit with a couple errors in the output log so I decided to install the .NET framework like you recommended. I restarted everything and got hit with errors again. One of them asked me to get an older version of the .NET framework (4.7.1). If anyone knows what the issue is I'd appreciate the help.
@@boreddev9252 Yeah I was just confused because there were two versions on the site. There's the general .NET and there's the .NET framework. I needed to download both.
Thank you for the video due to this I am able to solve the intellisense problem with C# in VS code. I am searching for the solution for hours and I finally found it.
Exactly what I needed to know. I was following a Unity Tutorial by Brackey. He had the IntelliSense working and I didn't and was wondering why. This gave me my answer, thanks.
Great advice! (One thing, maybe move the mic back or play with your mic settings. I had to turn the volume way down to avoid all the sticky mouth noises that were setting my mysophonia off.)
Hi i have a problem i dont know why when i oppening ws code on the down right side there are write Some projects have truoble loading. Please review the output for more details And i dont now whats happend and how to fix that can u help please
Hi thanks for the video. I followed the steps and my project loads correctly in vscode but intellisense still not working even after regenerating project files
Thank you for this video. I kept seeing that I needed to change the selected editor externally. I assumed that had to be in the hub somewhere. wasted 20 min instead of finding your video.
Thanks a lot, I had to follow till regenerate, then after a couple of failed tries I used the VS code to open a new folder before retrying open C# project from unity editor that's when intellisense started working.
I followed all your steps, but VS code still refuses to do intellisense - for certain methods. E.g. it will recognize Input.GetKeyDown, but not the OnCollisionEnter method. Studio 2019 does it all perfectly.
can you please make a video on how to setup unity from start, i searched ur channel for unity installation tutor but only found this vid. You showed almost everything in this video thats grt✌🏻 but it could be better if you show it from start Unity Hub -> the licensing -> The Unity -> The Code Editor n all, Thanks🙂
When I check Package Manage, I notice that Visual Studio Code Editor is already installed in the project. However, when I go to Preferences and click the External Script Editor dropdown, it doesn't show Visual Studio Code Editor as an option. Does anyone know why this might be happening or how I could find the vs code editor?
I've been following your videos for a few days now, sure am glad I found you. I'm so green on Unity a little bit better with VS but please answer a couple quick questions. As I'm coding Pacman your VS has the left side showing all the files etc in Unity, with your coding window split, I can split a window in VS but How do you get this left side menu? Also, since I'm halfway thru doing pacman by hand, but I'm getting some goofy errors and wanted to download and install your project code, and compare each for educational purposes.... If I do that what happens to project already started?
thank you for this tutorial it helped a lot , I was having trouble switching Microsoft Visual Studios to Microsoft Visual code! The only issue I'm having as of right now is when I open the C# I'm getting a .NET Core SDK error of it not being able to be located, if there is any suggestions on what to do about that I'll appreciate it!
Currently trying to follow this, though can't get past the "External Script Editor" bit. When I click the drop down menu there, nothing shows up. Just shows "Open by file extension" and "browse". Any clue what I'm missing here??
I loved the video but I wanted to know if you could be so kind to share your UI configuration like, for instance, your font, font size, etc. By the way, I really appreciate your content and I instantly subbed! Keep it up.
I use the built-in Dark+ (default dark) color theme. I like to use a font called FiraCode (github.com/tonsky/FiraCode) because it has custom ligatures, but I turn that off for my videos because it confuses people who aren't familiar with them. No specific font size because I tend to increase and decrease the size often using Ctrl/Cmd + and Ctrl/Cmd - keyboard shortcuts. Generally, mine is on the larger size though.
Hey I ran into problems when following your tutorial. When I made a C# script to see if everything was working correctly it came up with warn and fail because I didn't have .Net so I installed the latest version .Net 7 and I was hoping it would fix the issues but it didn't and now it's saying "warn" or "fail." It says it failed t load my project file and I'm really confused I found a post on stack overflow about this same problem but they had no solutions.
Awesome video, the biggest problems I had with code, was debugging was really bugged, and curly braces are inline with method braces, not in the next line( the most important thing for me in context of mentioned problems ) how did you do that?
That's a newer feature of VS Code. It just prevents malicious code from running if you were to accidentally open something you didn't mean to. You can trust the folder for your project.
I just love how much faster vs code loads, the themes, and how it has the file explorer open in it
A quick reset of Omnisharp did the trick for me. Ctrl+Shift+P in VSC and select 'Omnisharp: Restart Omnisharp'.
Nobody ever told me visual studio and visual studio code were different! Thanks. After 2 days of research, I found such a good vid and I'm finally able to do something. Definitely gonna leave a like. 😄
All details included, such a useful vid.
Today I learned VS and VS code are two different things... super helpful video, thanks!
Thank you so much!!! My intellisense has not been working for weeks and I could not figure out why until wathcing this video.
Nice timing. I was about to lookup a tutorial regarding this.
Nice timing indexed
OR ANYONE STARTING UNITY IN 2022, PLEASE DO THIS BEFORE WRITING ANY SCRIPTS:
Unity and Visual Studio will sometimes have a compatibility issue where something called Intellisense does not work. Intellisense is your code completion, and much more. It should be fixed immediately.
Step 1:
Close Visual Studio
Step 2:
In Unity, go to Edit < Preferences < External Tools (left part of the Window)
Step 3:
In External Tools go to the part that says External Script Editor (this should be on which ever Visual Studio editor you are using (for me it defaulted to "Open by File Extension"
Step 4:
Make sure Generate all csproj files are checked, and Editor Attaching is checked
Step 5:
Open the C# script you were trying to open earlier.
I copied it from mEmEMan as i was facing this problem
you are a godsend
3rd time attempting unity and the first time i manadged to sync up coding, thank you
Thank you SO MUCH! I watched a game tutorial video and they skipped how to connect Unity with the coding program and stuff. Stuck there for a while until I found your video 😅
Wow, this video saved me. What you didn't in the video didn't exactly help me but when you mentioned that omnisharp should have good logs, I checked it out and found out that my dotnet version was outdated and I needed to update it. Once I updated dotnet, I restarted vscode and regenerated the project and everything worked again!
I can't recommend this guy enough. I made more progress in 2 days than in a week.
This was exactly what I was looking for! Super helpful, thank you!
Great video as always. I use Visual Studio since it came as default, but I might change to VSCode since it is more lightweight.
Thank you!! I was having problems with classes not showing up properly. Now it is working as I need. Cheers
You are an incredible human. This video was so clear and concise. Visual Studio Code is finally working how it was meant to and I'm so excited. Thank you :)
Thanks for this helpful intro!
for all the user that are seeing this video a year later like me ;)
the new package has a blue icon and it does not say powered by omnisharp, however it works the exact same way as shown here. this is the same extension as show in the video: ms-dotnettools.csharp
below the title C#
Base language support for C#
by microsoft, right now its v1.26.0 and in unity the package also has one .5 1 version higher :=)
glad you posted this, tried swapping to VS Code a while back but could never get the SDK to download, had the same problem today but realized my brave browser is just broken as hell when it comes to that website in particular. switched to windows explorer for 2 seconds and it downloaded no problem. wonderful knowing that i can get it to work I always wanted an upgrade to my text editor. visual studio is fine and everything but man it is kinda frustrating to see a difference in the colors of your text and visual studios. being that you posted this to help people switch over is amazing.
It's showing me "Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)" any idea how to fix this? I've tried looking on StackOverflow to no avail.
Thank you so much I've been trying to figure this out for a VERY long time
If you are still having problems, download the .NET Framework 4.7.1 Developer Pack, as this specific targeting framework is used by many versions of Unity: dotnet.microsoft.com/en-us/download/dotnet-framework/net471
A recent update to the C# Omnisharp extension in VS Code required me to download .NET 6 (or newer) in order for my projects to load correctly in VS Code. The download page is here: dotnet.microsoft.com/en-us/download/dotnet
You may also need to restart your Windows computer to allow system environment variables to update.
If all else fails, follow these steps: code.visualstudio.com/docs/other/unity#_prerequisites
Thank you🥲
i downloaded and installed the sdk still doesnt work plz help.
@@supernovatluthelightoftheu3221 Close your vs code and reinstall .NET core SDK
It worked for me
@@sweif677 I did
@@supernovatluthelightoftheu3221 I have read that a new update means that a critical package (MSBuild) for the C#(OmniSharp) extension is no longer installed alongside. I had to actually go install Visual Studio and choose the .NET Framework package during installation in order for VSCode to work.
Very weird and convoluted installation process but it worked for me.
Omg thanks for this tutorial I was trying to find tutorials like this for years and finally i found one
Loved the tutorial. It's very concise. I'm dealing with an issue on my end though. I was hit with a couple errors in the output log so I decided to install the .NET framework like you recommended. I restarted everything and got hit with errors again. One of them asked me to get an older version of the .NET framework (4.7.1). If anyone knows what the issue is I'd appreciate the help.
did you find a solution for this?
@@boreddev9252 Yeah I was just confused because there were two versions on the site. There's the general .NET and there's the .NET framework. I needed to download both.
Very well put together video. Easy to follow, worked like a charm. Thank you !!
Thank you for the video due to this I am able to solve the intellisense problem with C# in VS code. I am searching for the solution for hours and I finally found it.
Thank you so much for this video. It was very useful for my Unity setup with VS Code!
10:58 I noticed that theres an italized code snippet auto-suggest. how do you turn that on (& off)?
Exactly what I needed to know. I was following a Unity Tutorial by Brackey. He had the IntelliSense working and I didn't and was wondering why. This gave me my answer, thanks.
THANK YOU!!!!! Oh my god I spent days trying to fix this issue and you solved it in minutes!
I remember the days of Unity 5 when another editor was used. It was so long ago I forgot the name of the editor lol
MonoDevelop!
Great advice!
(One thing, maybe move the mic back or play with your mic settings. I had to turn the volume way down to avoid all the sticky mouth noises that were setting my mysophonia off.)
Had to install .NET Framework 4.7.1 Developer Pack, only then it worked for me. Very helpful thanks.
Plz let me know do you recommend this?
Thank you soooo much for this video! I've been suffering for way too long, you're the best
thank you so much! This will make my game development be much quicker :)
Hi i have a problem i dont know why when i oppening ws code on the down right side there are write
Some projects have truoble loading. Please review the output for more details
And i dont now whats happend and how to fix that can u help please
I have the same issue- can't figure out how to fix it
Same
woww....i was in trouble until this ......THANKYOU
This video was so helpful i wanted to connect vs code to unity and it worked thanks!
Hi thanks for the video. I followed the steps and my project loads correctly in vscode but intellisense still not working even after regenerating project files
same here
Oh hell yea this video fixed the Intellisense problem I was having! Thank you thank you!!!
Did you have to install Microsoft.Unity.Analyzers through NuGet? If so, could you explain how to do that please?
Thank you for this video. I kept seeing that I needed to change the selected editor externally. I assumed that had to be in the hub somewhere. wasted 20 min instead of finding your video.
TNice tutorials is exactly about everytNice tutorialng that you'll ever need to do to make soft on soft soft
Thanks a lot, I had to follow till regenerate, then after a couple of failed tries I used the VS code to open a new folder before retrying open C# project from unity editor that's when intellisense started working.
I followed all your steps, but VS code still refuses to do intellisense - for certain methods. E.g. it will recognize Input.GetKeyDown, but not the OnCollisionEnter method.
Studio 2019 does it all perfectly.
Thank you! this really helped me get my unity to work with my vscode. Appreciate you!
the logs on vs code says, i need .net 4.7.1, visual code studio didnt even pick gameObject....
can you please make a video on how to setup unity from start, i searched ur channel for unity installation tutor but only found this vid. You showed almost everything in this video thats grt✌🏻 but it could be better if you show it from start Unity Hub -> the licensing -> The Unity -> The Code Editor n all, Thanks🙂
thanks for the help I was stuck for so long without VS i thought I was just being dumb.
Thank you but i have a problem that it just gets the code that was in the script but when i try void OnCollisionEnter2D it just doesn't show up😢
i use visual studio 2022 so i just install the unity development workload and then change the code editor in unity to vs 2022
When I check Package Manage, I notice that Visual Studio Code Editor is already installed in the project. However, when I go to Preferences and click the External Script Editor dropdown, it doesn't show Visual Studio Code Editor as an option. Does anyone know why this might be happening or how I could find the vs code editor?
Same I am not getting VS code option in anywhere.What to do
I've been following your videos for a few days now, sure am glad I found you. I'm so green on Unity a little bit better with VS but please answer a couple quick questions. As I'm coding Pacman your VS has the left side showing all the files etc in Unity, with your coding window split, I can split a window in VS but How do you get this left side menu? Also, since I'm halfway thru doing pacman by hand, but I'm getting some goofy errors and wanted to download and install your project code, and compare each for educational purposes.... If I do that what happens to project already started?
THANK YOU this helped alot
Thank you so much now i can get to work on coding my game
BUT, what about debug break-points? I couldn't get this working in VS Code recently and seems it might be broken?
I'm looking for that too, how you fix it?
@@EremesNG did you fix it?
thank you for this tutorial it helped a lot , I was having trouble switching Microsoft Visual Studios to Microsoft Visual code! The only issue I'm having as of right now is when I open the C# I'm getting a .NET Core SDK error of it not being able to be located, if there is any suggestions on what to do about that I'll appreciate it!
I wish I had seen this a long time ago. Would of saved me alot of time.
Great video! Helped me set up VS code in a matter of minutes
Thank you so much for this video, you helped me a lot!!
Currently trying to follow this, though can't get past the "External Script Editor" bit. When I click the drop down menu there, nothing shows up. Just shows "Open by file extension" and "browse". Any clue what I'm missing here??
The External Script Editor chapter 👌
very very underestimated channel ever
how did you know I was having trouble with this?? Thanks for the vid lol.
I loved the video but I wanted to know if you could be so kind to share your UI configuration like, for instance, your font, font size, etc. By the way, I really appreciate your content and I instantly subbed! Keep it up.
I use the built-in Dark+ (default dark) color theme. I like to use a font called FiraCode (github.com/tonsky/FiraCode) because it has custom ligatures, but I turn that off for my videos because it confuses people who aren't familiar with them. No specific font size because I tend to increase and decrease the size often using Ctrl/Cmd + and Ctrl/Cmd - keyboard shortcuts. Generally, mine is on the larger size though.
@@Zigurous Thank you very much for your response!
thanks for this vid bruhh.. really helps me setting up🔥
Thanks for the tutorial! It helped me a lot.
I needed This
It worked for me, thank you
Thank you
Literally my savior
Hey I ran into problems when following your tutorial. When I made a C# script to see if everything was working correctly it came up with warn and fail because I didn't have .Net so I installed the latest version .Net 7 and I was hoping it would fix the issues but it didn't and now it's saying "warn" or "fail." It says it failed t load my project file and I'm really confused I found a post on stack overflow about this same problem but they had no solutions.
Thank you so much for this tutorial!! God Bless you!
Thank you, it helped!
thank you so much, for the video, this fixed my intellisence issue. 👍⭐⭐⭐⭐⭐
What is the background music you're using, it's very mellow.
Great tutorial. Thanks man!
My VCS Explorer doesn't show anything, only the actual code Im working on. I have no idea what Im doing wrong, please help??
After "powered by OmniSharp disappeared VS Code doesn't work properly with Unity :( is there way to fix it?
Thank you So much for ur ti and support
Thank u soo much. i was wondering y it didnt soft the sa for as well
Excellent Video
How I can install the package of visual studio code in unity older version
Thanks a lot, very great video, really helpful !
Awesome video, the biggest problems I had with code, was debugging was really bugged, and curly braces are inline with method braces, not in the next line( the most important thing for me in context of mentioned problems ) how did you do that?
it was really helpful
thankyou
thank so much this help a lot
Thank you, that was usefull to know and i did use it.
Helped a lot thanks
VS code is not coming in the preferences dropdown
When i try to open my code it gives me a warning and asks whether to trust current folder. What should i do?
That's a newer feature of VS Code. It just prevents malicious code from running if you were to accidentally open something you didn't mean to. You can trust the folder for your project.
@@Zigurous Thank you for your answer!
Awesome! Thank you!
Whats your extensions? It seems you have some intellicode that suggest you to write your next script by tabbing it
Can you list your extensions?
This content is great, thanks
That was great. Thank you.
I dont know why but i dont have the visual studio code editor
How do you attach to the editor for breakpoints?
#pro Perfectly executed How-To-Torial! You should make another vid called "How-To make How-To videos Tutorial"
THANK YOU!!
THANK YOU SO MUCH 😍
It keeps failing to install no matter how many times I regenerate files 8:50
thanks for this tutorial