Issues with creating a c++ class

So i started Obstacle assault and I have been having a bunch of weird erros with my vscode. The first issue I have been having was that when I create a class it does not add an option in the tools menu to open the class from unreal engine. If I need to open it manually it doesn’t create a workspace in the project folder either. The only way I can open the actual file is to open it directly from vscode. Even then it doesn’t work because im getting errors under all the include statements. I also get an error where it says I need to recompile because the module wasn’t found

The error looks like this
"Successfully added class ‘MovingPlatform’, however you must recompile the ‘ObstacleAssault’ module before it will appear in the Content Browser. Failed to automatically hot reload the ‘ObstacleAssault’ module.

Some details about my project to help you help me
Using unreal engine 5.0.3
Using the Unreal Learning kit like asked in the course
Installed .net 6.0 because the one installed in the course was giving me errors

3 Likes

I’m not very good with unreal because I do unity, but I’ll give you the early answer with the chance it solves your issue, anyways It sounds like you may be experiencing some issues with the Unreal Engine 5.0.3 integration with Visual Studio Code. Here are a few suggestions that might help you to resolve the issues you’re facing:

Ensure that you have installed the necessary extensions in Visual Studio Code, such as the “Unreal Engine” extension and the “C++” extension. You can install these extensions by going to the extensions tab in Visual Studio Code and searching for them by name.

Make sure that you have set up the correct build configuration for your project in Visual Studio Code. To do this, navigate to the “Debug” tab and select “Edit Configurations”. Then, select the appropriate build configuration for your project.

Verify that your Unreal Engine project has been set up to use Visual Studio Code as its primary IDE. To do this, navigate to the “Edit” menu in Unreal Engine and select “Editor Preferences”. Under the “General” section, locate the “Source Code” option and select “Visual Studio Code” from the dropdown menu.

Try running the “Generate Visual Studio Code project files” command from the Unreal Engine editor. This will ensure that Visual Studio Code has all of the necessary files and settings to work with your project.

Check that your environment variables are set up correctly. Specifically, check that your PATH variable includes the path to your Unreal Engine installation directory and your Visual Studio Code installation directory.

Hope this helps!

My bad I accidentally hadn’t finished typing before I submitted which is why there’s an edit button

2 Likes

So I made sure I had all those settings. I didn’t try to generate my project files so I will do that when I get a chance. My only concern is when I tried to switch to visual studio instead of vscode, i got the same error when creating a c++ class: “Successfully added class ‘MovingPlatform’, however you must recompile the ‘ObstacleAssault’ module before it will appear in the Content Browser. Failed to automatically hot reload the ‘ObstacleAssault’ module.”

2 Likes

Hmm interesting, If you’re getting the same error when trying to create a C++ class in Visual Studio, it’s possible that the issue may be with the Unreal Engine itself rather than with Visual Studio Code. Here are some things you can try to resolve the issue:

Check that your Unreal Engine project is set up correctly. Make sure that the project has been configured to use C++ and that the appropriate build configuration is selected.

Kinda a last resort if all else fails, If you aren’t very far, Try rebuilding your project from scratch. Delete any intermediate and saved folders from your project directory, then regenerate your Visual Studio project files and rebuild the project.

Check that you have the necessary dependencies installed. Make sure that you have installed all of the required dependencies for your Unreal Engine version and that they are up-to-date.

Ensure that your environment variables are set up correctly. Check that your PATH variable includes the path to your Unreal Engine installation directory.

If all else fails, you may want to try reinstalling Unreal Engine and/or Visual Studio to see if that resolves the issue.

If nothing seems to be working, even slightly, this might need to get brought up to a professional, hope this helps!

1 Like

Thank you! I noticed some other people who have my issue seem to all have it stem from a .net installation issue. Do you know why that might be?

2 Likes

I’m glad I could help you a bit, Issues with .NET installations can sometimes cause issues with Unreal Engine projects because Unreal Engine uses .NET to compile and package C++ code. Here are a few reasons why a .NET installation issue could be causing the errors you’re experiencing:

Unreal Engine requires a specific version of .NET to be installed. If you have an incompatible version of .NET installed or if your installation is corrupted, it could cause issues when compiling C++ code in Unreal Engine.

If you have multiple versions of .NET installed on your system, it’s possible that Unreal Engine is using the wrong version. This can lead to conflicts and errors when compiling C++ code.

In some cases, issues with .NET can cause conflicts with other dependencies that Unreal Engine relies on. This can lead to errors when trying to create or compile C++ code in Unreal Engine.

Hope this can clear up some of your issue!

1 Like

Do certain Unreal Engine version need specific .net versions, or can I just install the latest release and expect it to work for all versions of Unreal?

2 Likes

Different versions of Unreal Engine may require different versions of .NET to be installed. Unreal Engine 5.0, for example, requires .NET Framework 4.7.2 or later.

It’s generally a good idea to check the system requirements for your version of Unreal Engine to see which version of .NET it requires. You can usually find this information on the Unreal Engine documentation website or in the release notes for the version you’re using.

That being said, it’s usually safe to install the latest version of .NET even if it’s not explicitly required by your version of Unreal Engine. This is because newer versions of .NET usually include updates and bug fixes that can improve performance and stability, even if they’re not strictly necessary for your specific use case.

However, if you’re experiencing issues with your Unreal Engine project, it’s worth checking that you have the correct version of .NET installed and that it’s properly configured for use with Unreal Engine.

Hope this helps

1 Like

Thank you!

1 Like

Anytime, glad I could help, did i solve your original problem?

1 Like

I did not have the opportunity to check yet. I’ve been responding in-between classes. I won’t be able to check until later tonight. I greatly appreciate it and just want to say the community appreciates all the help you give! I will update the thread if I have a solution or not

1 Like

Thanks, I feel you, I’m actually in 9th grade(I’m 15 Saturday) so I respond in between classes as well, feel free to take all the time you need!

1 Like

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

Privacy & Terms