I have an issue in visual studio code

I don’t know how to solve it please some one help me.

Hi Friend, Are you using Unreal 4? Unreal 5 won’t work with this course.

If you are using Unreal 4, It appears you are not working from a workspace here. Here are a few things you could try :

Go to Unreal and Under File → Open Visual Studio Code. I think this should open your game in a workspace with a .code-workspace file.

Once you’re in the workspace, if you’re still having errors, try to click the lightbulb and see if it suggests a fix of adding a specific includepath. If so, click that, and from unreal, File-> Generate Visual Studio Code to refresh the project.

Hopefully this helps, or helps move you in the right direction. I struggled with this for a bit. I was using UE5, however, which is not compatible with this course.

Cheers,
Tele

Post thought, as long as your code is being compiled correctly, you technically don’t have to worry about the red squiggles. It’s just a failure of the Intellisense feature. It can’t understand what the code is trying to say, but the compiler is smarter than Intellisense. If things are compiling correctly, you can ignore the error squiggles for now if you want to focus on building the game.

after updating code project.

there is no option i don’t know what to do.

where ?

can you please share the screen short.

Ah interesting, I am using 4.27, might explain the difference in features. I am not experienced with this stuff either but do know that you have to be working from a workspace in VSCode for UE Intellisense to work. I powered through the bull cow game with no intellisense, which made it rough but the code all compiled fine. You’ll know you’re working from a workspace when there’s a .code-workspace file in the folder you’re working out of in Visual Studio Code. It will also say (workspace) in the header bar. I think you can double-click the VScode file in the source folder of the game from your file explorer as a way of opening the workspace. I also think you can open a workspace from a file, but the only way I’ve gotten a correctly populated .code-workspace file is when I open VSCode through Unreal. The .code-workspace file has settings in it including the include paths for Unreal’s headers, located in a program files / unreal / source folder, and the include paths for your specific project, which would point to where the bull cow game was stored on your machine. The .code-workspace file tells Intellisense where to find the header files, but doesn’t compile the actual code.

Really hope this helps, let me know if you have any other questions.
Cheers,
Tele

Edit : Also, the lightbulb I referred to is the one that appears to help fix red squiggles in VSCode.

first of all thanks man ,but the thing is it didn’t show the option of .code-workspace file.

It’s all pretty confusing to me but I was struggling with the red squiggles through the entire Bull Cow course… I am not sure why it isn’t giving you an option of opening a workspace either. I did the Bull Cow game in Unreal 5 and because of that my include paths were messed up for the entire project. Once I finished the Bull Cow game I installed Unreal 4.27 and now, I have the option to Open VSCode directly from Unreal :

and when I do, it opens a .code-workspace file with all of the associated project files.

Good luck, I’ve got to get some sleep now. Let me know how things go. :slight_smile:
Tele

That doesn’t look like you have installed the IntelliSense fixes extension. Please see “VSCode Intellisense Fix” in the Bull Cow Game section.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms