Course contentsShow
← Unreal Engine Game Development
Lesson 11 of 8801. Foundations and Editor WorkflowFree lesson

Generating Project Files from Build Scripts

Learners will use the Unreal Build Tool to regenerate project files, ensuring the IDE stays synchronized with the current source structure.

In this lesson, you will learn how to synchronize your IDE with your Unreal Engine project structure by regenerating project files using the Unreal Build Tool.

Why Regenerate?

When you add new C++ classes, modify module dependencies, or change your project's directory structure, your IDE (like Visual Studio or Rider) may lose track of where files are located. If the IDE can’t find a header file or doesn't recognize your new classes, you will see "IntelliSense errors" or red squiggly lines in your code, even if your code is technically correct.

Generating project files acts as a "refresh button" for your IDE. It instructs the Unreal Build Tool to scan your folders, re-evaluate your .Build.cs configuration files, and create a fresh project file (like a .sln file) that perfectly matches the current state of your project.

How to Perform the Refresh

The easiest way to perform this action is through your project’s root folder. Locate your project's .uproject file in your file explorer.

  1. Right-click the .uproject file.
  2. Select "Generate Visual Studio project files" from the context menu.

Behind the scenes, this executes a command-line utility called GenerateProjectFiles.bat. This tool performs a clean sweep of your source code and generates the necessary configuration files for your IDE. Once it finishes, you will notice that your project files have been updated, and your IDE will once again be able to navigate your classes, headers, and dependencies without errors.

When should you do this?

You should run this process whenever you make structural changes to your project, such as:

  • Adding a new C++ class via a file explorer instead of the Editor.
  • Adding a new Module to your Project.uproject or .Build.cs file.
  • Switching between different engine versions.
  • If your IDE suddenly stops recognizing your classes or stops providing code completion.

By keeping these files synchronized, you ensure the IDE stays an efficient partner in your development process rather than a source of confusion.

Key Takeaway: Generating project files is your primary tool for fixing IDE synchronization issues and ensuring your build environment accurately reflects your current source code structure.