What am I missing? I'm following a tutorial and I got to this point. The guy is "referencing the rigid body and when he typed "rigi" a drop down suggestion appeared where he clicked the rigidbody selection, but when I type it out, no drop down. I even tried typing it out in its entirety, but nothing
Not downloaded yet
About this post
- Posted
- Archived
- Score
- 17 · 100% up
- Kind
- Image
- ID
- pcaid0
80 comments
It's called Intellisense, I think the methods of enabling are different depending on which code editor you are using. Goolge enable intellisense and your editor and you should easily find how to do it.
Its Visual studio code. I'll try to look it up.
Do I need to install any extensions as well?
I think so, but I'm not sure which one. I mainly use Visual Studio Community.
The YouTuber is using Visual Studio Community Edition. Not VS Code.
Visual Studio Community Edition has a native extension for Unity Intellisense and Unity hooking.
I enabled intellisense, but it just says "No suggestions". I'm definitely missing something.
I can help you out on Discord, if you send me a DM
I appreciate the offer, but I already gave up on it and just unistalled Visual Studio Code. I just went with Visual Studio 2019 instead.
I think I figured out the issue to be something about the incorrect version of the .NET framework, but I had already downloaded one of the versions while trying to fix it and it didn't solve the problem, but it did clear an error message in VSCode that was apparently supposed to tell me which framework to use (I didn't find that out until after) but now I don't know how to find and delete the version of the framework that I don't need, and have no other way of figuring out which version I would've needed.
That was probably a good idea. I personally prefer JetBrains Rider, as I use JetBrains IDEs for all my different programming projects.
Do you have the "using UnityEngine" reference? That is where rigidbody is coming from
Yeah. It's in the first line. Exactly as it was when I opened the script. I cleaned it up exactly like he did in the video, but left that at the top. I type in "private" and it recognizes it as a keyword, then I start typing "rigi" and there are "no suggestions". Even if I type it out fully, it doesn't recognize it as anything.
Maybe try adding this after that line: "using UnityEngine.PhysicsModule;"
Deleted before we saved it.
Thats exactly how I got into the script. I created a folder in the assets window labeled "scripts" I opened the folder, right clicked, clscrolled to "create", clicked C# Script, and it took me to Visual Studios Code where it already had a bit of code written. Including the "using unity" at the top. Everything should be working, and yet its not recognizing it. I have no idea why I'm having this issue.
Deleted before we saved it.
Im not expert in programming, but I think Unity uses like 3 libraries that are there by default in Visual Studio if you successfully chose VS as your default coding software. I only see one in your picture and I have not idea if that is the problem or not, but you migjt wanna check
I'm not sure what exactly you mean. The picture is a screenshot of the video I was watching. I'm using Visual Studio Code, which is the one recommended for use in unity by most. I don't have any other coding software on my PC. Before I downloaded VSC, I couldn't even access any of the scripts.
Then don't mind me haha Sorry for your time
TLDR: use visual studio for now. There’s a lot less setup involved.
The frustration you are feeling is normal. Game dev can have A LOT of roadblocks especially when you are beginning. My advice is to not get too stuck. Setting up vs code can be a harrowing process. For some people it’s super easy and quick, for others they have more trouble. I’ve had tons of trouble setting it up on one comp and easy with another. One valuable skill you should learn if you want to keep continuing is to know when to stop struggling and pivot to the easy solution, which in this case would to just use visual studio. Later when you’re not frustrated, try setting it up again, you’ll get it eventually.
Thats what I did. Normally I try to face the issue and fix it, instead of finding the easy way around, but this one was just too difficult. I finally cracked and downloaded Visual Studio instead. Which isn't bad, or anything. I was just told that Code was better. After the struggle I went through, though, I have to disagree.
Now the battle is trying to figure out why my code is throwing errors when I've written it exactly how it was in the tutorial.
Yes I know what you mean. Being a good developer means you have to be persistent but also choosing your battles can be extremely helpful as well. Glad you got your editor working, good luck with the code!
I had a similar thing happen when I started Unity. In Visual Studio, just under the Extensions tab at the top, there's a little drop down that should say "Attach to Unity." There's a couple hoops to jump through to get it setup iirc. But until I got that hooked up, I had to manually type out Rigidbody2D and all that jazz. You can see it in the picture you posted. There's a green arrow pointing to the right.
Even when I typed out Rigidbody 2D entirely, it didn't recognize it. It wasn't recognizing any keywords from Unity. Nothing related to Unity whatsoever. I give up trying to figure out what could be causing it. Just gonna scrap it all and uninstall everything. Not sure whether I even want to try again at this point. I'm livid.
In unity Go to preferences,External tools and select VSC in external script editor maybe that will work
I already have it set as the external script editor. Based on what I've seen in a video I just watched, it has something to do with the required .NET framework for Visual Studio Code. Unfortunately, when I was following the step by step instructions on Visual Studios support page, I ended up downloading some random .NET framework because I wasn't sure which version to download. In doing so, it cleared an error message in Visual Studio Code, which I thought was a good thing. However, upon watching the video, that error was needed to display which version of the .NET framework I needed for VSC. Now, I don't know how to find and delete the versions of framework I downloaded earlier, which I need to do in order to bring back the error message and figure out which framework I need to download.
In the video, after downloading the proper framework, his VSC worked perfectly fine. Thats my solution, but now I have a whole different problem... finding the crap I downloaded and deleting it. But I have no idea how to delete .NET framework or which ones I need to delete.
Deleted before we saved it.
I did have it set as the external editor. It still wasn't working at all.
I did end up scrapping VS Code and going with VS 2019 instead. After setting that as the external editor, it works fine so far. VSCode is just broken for me. No idea how to fix it.
VS Code requires some extensions to work properly with unity. https://code.visualstudio.com/docs/other/unity Make sure you have the unity tools and debugger installed
Yeah, I had all those extensions, but it still wasn't working.