How to set up Visual Studio Code for Unity

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 216

  • @treydiaz3633
    @treydiaz3633 Před rokem +19

    I just love how much faster vs code loads, the themes, and how it has the file explorer open in it

  • @KappKee
    @KappKee Před 2 lety +4

    A quick reset of Omnisharp did the trick for me. Ctrl+Shift+P in VSC and select 'Omnisharp: Restart Omnisharp'.

  • @candleo.
    @candleo. Před 2 lety +20

    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. 😄

    • @candleo.
      @candleo. Před 2 lety +2

      All details included, such a useful vid.

  • @jordanbentley
    @jordanbentley Před 10 měsíci +2

    Today I learned VS and VS code are two different things... super helpful video, thanks!

  • @jacobwigent1931
    @jacobwigent1931 Před 2 lety +1

    Thank you so much!!! My intellisense has not been working for weeks and I could not figure out why until wathcing this video.

  • @Questionable_Insights
    @Questionable_Insights Před 2 lety +5

    Nice timing. I was about to lookup a tutorial regarding this.

  • @SpaceifyYT
    @SpaceifyYT Před 2 lety +3

    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

  • @jademonass2954
    @jademonass2954 Před rokem +1

    you are a godsend
    3rd time attempting unity and the first time i manadged to sync up coding, thank you

  • @ledamdevol2186
    @ledamdevol2186 Před rokem

    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 😅

  • @georgemiranda1440
    @georgemiranda1440 Před 2 lety

    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!

  • @Alex-wh3zw
    @Alex-wh3zw Před rokem

    I can't recommend this guy enough. I made more progress in 2 days than in a week.

  • @Geeks-Odyssey
    @Geeks-Odyssey Před 2 lety +7

    This was exactly what I was looking for! Super helpful, thank you!

  • @Francisco-Gutierrez
    @Francisco-Gutierrez Před 2 lety +9

    Great video as always. I use Visual Studio since it came as default, but I might change to VSCode since it is more lightweight.

  • @FaceCol
    @FaceCol Před rokem +1

    Thank you!! I was having problems with classes not showing up properly. Now it is working as I need. Cheers

  • @mossthecreator
    @mossthecreator Před 2 lety +2

    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 :)

  • @vrfxrealtime
    @vrfxrealtime Před rokem +1

    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 :=)

  • @Meithighs
    @Meithighs Před 2 lety +1

    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.

  • @LiamOfOzz
    @LiamOfOzz Před 2 lety +1

    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.

  • @amarpatel6073
    @amarpatel6073 Před 2 lety +2

    Thank you so much I've been trying to figure this out for a VERY long time

  • @Zigurous
    @Zigurous  Před 2 lety +22

    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

    • @ricoash6625
      @ricoash6625 Před 2 lety

      Thank you🥲

    • @supernovatluthelightoftheu3221
      @supernovatluthelightoftheu3221 Před 2 lety

      i downloaded and installed the sdk still doesnt work plz help.

    • @sweif677
      @sweif677 Před 2 lety

      @@supernovatluthelightoftheu3221 Close your vs code and reinstall .NET core SDK
      It worked for me

    • @supernovatluthelightoftheu3221
      @supernovatluthelightoftheu3221 Před 2 lety

      @@sweif677 I did

    • @CCheukKa
      @CCheukKa Před 2 lety +2

      @@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.

  • @IzuliSftAlt1
    @IzuliSftAlt1 Před rokem

    Omg thanks for this tutorial I was trying to find tutorials like this for years and finally i found one

  • @lavaa7392
    @lavaa7392 Před 2 lety +9

    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
      @boreddev9252 Před 2 lety

      did you find a solution for this?

    • @lavaa7392
      @lavaa7392 Před 2 lety +1

      @@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.

  • @pianochad
    @pianochad Před rokem +2

    Very well put together video. Easy to follow, worked like a charm. Thank you !!

  • @meetpatel6632
    @meetpatel6632 Před rokem

    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.

  • @yellowdev5320
    @yellowdev5320 Před 2 lety +2

    Thank you so much for this video. It was very useful for my Unity setup with VS Code!

  • @stephenkentperez7705
    @stephenkentperez7705 Před 2 lety +2

    10:58 I noticed that theres an italized code snippet auto-suggest. how do you turn that on (& off)?

  • @drsev61
    @drsev61 Před 2 lety

    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.

  • @khaledalshaikh5991
    @khaledalshaikh5991 Před rokem

    THANK YOU!!!!! Oh my god I spent days trying to fix this issue and you solved it in minutes!

  • @HikikomoriDev
    @HikikomoriDev Před rokem +1

    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

  • @AndrewLyon23
    @AndrewLyon23 Před rokem

    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.)

  • @omipat
    @omipat Před 2 lety

    Had to install .NET Framework 4.7.1 Developer Pack, only then it worked for me. Very helpful thanks.

  • @user-tl3fu9fc2f
    @user-tl3fu9fc2f Před 2 lety

    Thank you soooo much for this video! I've been suffering for way too long, you're the best

  • @useless.production
    @useless.production Před rokem +1

    thank you so much! This will make my game development be much quicker :)

  • @mru_lord8540
    @mru_lord8540 Před 2 lety +2

    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

    • @fiatlux805
      @fiatlux805 Před 2 lety

      I have the same issue- can't figure out how to fix it

    • @mattiiiww
      @mattiiiww Před 2 lety

      Same

  • @softart5235
    @softart5235 Před 2 lety +1

    woww....i was in trouble until this ......THANKYOU

  • @ibrahimalmurasil2008
    @ibrahimalmurasil2008 Před 8 měsíci

    This video was so helpful i wanted to connect vs code to unity and it worked thanks!

  • @Steve18795
    @Steve18795 Před 2 lety +3

    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

  • @plushgray
    @plushgray Před 2 lety

    Oh hell yea this video fixed the Intellisense problem I was having! Thank you thank you!!!

  • @maksimnarrates1826
    @maksimnarrates1826 Před 2 lety +1

    Did you have to install Microsoft.Unity.Analyzers through NuGet? If so, could you explain how to do that please?

  • @jasonmoor4210
    @jasonmoor4210 Před 2 lety

    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.

  • @doke4090
    @doke4090 Před rokem

    TNice tutorials is exactly about everytNice tutorialng that you'll ever need to do to make soft on soft soft

  • @michaeltomilobamfon3433

    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.

  • @Epistemophilos
    @Epistemophilos Před rokem +1

    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.

  • @HaunaniPao
    @HaunaniPao Před rokem

    Thank you! this really helped me get my unity to work with my vscode. Appreciate you!

  • @Nekotico
    @Nekotico Před 2 lety +1

    the logs on vs code says, i need .net 4.7.1, visual code studio didnt even pick gameObject....

  • @creativearts4917
    @creativearts4917 Před rokem

    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🙂

  • @Apple-ix9nj
    @Apple-ix9nj Před 2 lety

    thanks for the help I was stuck for so long without VS i thought I was just being dumb.

  • @irinaklemmer3176
    @irinaklemmer3176 Před měsícem

    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😢

  • @arunabhrakshit
    @arunabhrakshit Před 2 lety +2

    i use visual studio 2022 so i just install the unity development workload and then change the code editor in unity to vs 2022

  • @jacquelineparedes9385
    @jacquelineparedes9385 Před 2 lety +1

    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?

  • @ledschmidt1441
    @ledschmidt1441 Před 5 měsíci

    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?

  • @VRPlayYT-lb5fj
    @VRPlayYT-lb5fj Před 6 měsíci +1

    THANK YOU this helped alot

  • @sumrandomguy6957
    @sumrandomguy6957 Před rokem +1

    Thank you so much now i can get to work on coding my game

  • @justice83
    @justice83 Před 2 lety +5

    BUT, what about debug break-points? I couldn't get this working in VS Code recently and seems it might be broken?

    • @EremesNG
      @EremesNG Před rokem +1

      I'm looking for that too, how you fix it?

    • @JJforYoutube
      @JJforYoutube Před rokem

      @@EremesNG did you fix it?

  • @Prince_mdz
    @Prince_mdz Před rokem +1

    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!

  • @Labyrnthdom
    @Labyrnthdom Před 2 lety

    I wish I had seen this a long time ago. Would of saved me alot of time.

  • @tiesdenouden2396
    @tiesdenouden2396 Před 2 lety

    Great video! Helped me set up VS code in a matter of minutes

  • @RogerSthow
    @RogerSthow Před rokem +1

    Thank you so much for this video, you helped me a lot!!

  • @theUnfrench
    @theUnfrench Před rokem

    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??

  • @jamieperkins906
    @jamieperkins906 Před 2 lety

    The External Script Editor chapter 👌

  • @imw8721
    @imw8721 Před rokem

    very very underestimated channel ever

  • @morbus5726
    @morbus5726 Před 2 lety +1

    how did you know I was having trouble with this?? Thanks for the vid lol.

  • @eliplay123
    @eliplay123 Před 2 lety +2

    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.

    • @Zigurous
      @Zigurous  Před 2 lety +4

      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.

    • @eliplay123
      @eliplay123 Před 2 lety +1

      @@Zigurous Thank you very much for your response!

  • @jhaysuyom7827
    @jhaysuyom7827 Před rokem

    thanks for this vid bruhh.. really helps me setting up🔥

  • @alfonsomatsuoka9682
    @alfonsomatsuoka9682 Před rokem

    Thanks for the tutorial! It helped me a lot.

  • @alexanderhoffmann2995

    I needed This

  • @oportaldepedra2662
    @oportaldepedra2662 Před 10 měsíci

    It worked for me, thank you

  • @Pasora
    @Pasora Před 2 lety +1

    Thank you

  • @andywang3678
    @andywang3678 Před 2 lety

    Literally my savior

  • @blockblockgoose
    @blockblockgoose Před rokem

    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.

  • @jaffry5663
    @jaffry5663 Před rokem

    Thank you so much for this tutorial!! God Bless you!

  • @madplayer5
    @madplayer5 Před rokem

    Thank you, it helped!

  • @colingreen8470
    @colingreen8470 Před rokem

    thank you so much, for the video, this fixed my intellisence issue. 👍⭐⭐⭐⭐⭐

  • @mikethemusicman1978
    @mikethemusicman1978 Před 7 měsíci

    What is the background music you're using, it's very mellow.

  • @jonathanwilliamson2529

    Great tutorial. Thanks man!

  • @stefaniafiorucci9826
    @stefaniafiorucci9826 Před rokem

    My VCS Explorer doesn't show anything, only the actual code Im working on. I have no idea what Im doing wrong, please help??

  • @OrkhanJulfa
    @OrkhanJulfa Před rokem

    After "powered by OmniSharp disappeared VS Code doesn't work properly with Unity :( is there way to fix it?

  • @shumailasikander9009
    @shumailasikander9009 Před 2 lety

    Thank you So much for ur ti and support

  • @mounicadivya3456
    @mounicadivya3456 Před 2 lety

    Thank u soo much. i was wondering y it didnt soft the sa for as well

  • @janfeyen592
    @janfeyen592 Před rokem

    Excellent Video

  • @Lucy0806
    @Lucy0806 Před rokem

    How I can install the package of visual studio code in unity older version

  • @gabmuraz497
    @gabmuraz497 Před rokem

    Thanks a lot, very great video, really helpful !

  • @DePistolero
    @DePistolero Před 2 lety

    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?

  • @roshnithapamagar5333
    @roshnithapamagar5333 Před 2 lety

    it was really helpful
    thankyou

  • @shadowblaze6386
    @shadowblaze6386 Před 2 lety

    thank so much this help a lot

  • @tech.curiosity
    @tech.curiosity Před rokem

    Thank you, that was usefull to know and i did use it.

  • @falaghsepehr5504
    @falaghsepehr5504 Před rokem

    Helped a lot thanks

  • @mamtapatil1892
    @mamtapatil1892 Před rokem

    VS code is not coming in the preferences dropdown

  • @bartoszsiminski3884
    @bartoszsiminski3884 Před 2 lety +1

    When i try to open my code it gives me a warning and asks whether to trust current folder. What should i do?

    • @Zigurous
      @Zigurous  Před 2 lety

      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.

    • @bartoszsiminski3884
      @bartoszsiminski3884 Před 2 lety +1

      @@Zigurous Thank you for your answer!

  • @falling_reign
    @falling_reign Před rokem

    Awesome! Thank you!

  • @magia136
    @magia136 Před rokem

    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?

  • @romulosendoromulo
    @romulosendoromulo Před 2 lety

    This content is great, thanks

  • @zanarxhy
    @zanarxhy Před rokem

    That was great. Thank you.

  • @Shiftingreubix
    @Shiftingreubix Před rokem

    I dont know why but i dont have the visual studio code editor

  • @ivanivanovski1
    @ivanivanovski1 Před 5 měsíci

    How do you attach to the editor for breakpoints?

  • @afrakes4510
    @afrakes4510 Před rokem

    #pro Perfectly executed How-To-Torial! You should make another vid called "How-To make How-To videos Tutorial"

  • @WoodyBee
    @WoodyBee Před rokem

    THANK YOU!!

  • @tm001
    @tm001 Před 2 lety

    THANK YOU SO MUCH 😍

  • @wellzerc1357
    @wellzerc1357 Před 2 lety

    It keeps failing to install no matter how many times I regenerate files 8:50

  • @Crystal76900
    @Crystal76900 Před 2 lety

    thanks for this tutorial