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

Executing Live Coding and Hot Reloading

Learners will implement rapid iteration workflows by compiling and reloading C++ changes directly into the editor without restarting.

In this lesson, you will learn how to modify your C++ code and see the results inside the Unreal Editor instantly, without ever closing or restarting your project.

The Problem with Traditional Compiling

Normally, if you change C++ code, you would have to close the Unreal Editor, wait for your IDE (Visual Studio) to rebuild the entire project, and then re-launch the editor. This process can take minutes, which ruins your creative flow. Unreal Engine solves this with Live Coding and Hot Reloading.

Understanding Live Coding

Live Coding is the modern, preferred way to iterate. When you have your project open, look at the bottom-right corner of the Unreal Editor. You will see a small icon that looks like a play button or a small window—this is the Live Coding console.

When you modify your C++ code in Visual Studio, simply press Ctrl + Alt + F11. This triggers a build of only the specific code you changed. The engine "injects" your new logic into the running game without forcing a full restart.

A Concrete Example

Imagine you have an Actor with a Speed variable. You want to test if it feels right.

  1. In your header file, you have: float Speed = 100.0f;
  2. You decide it’s too slow, so you change the code to: float Speed = 500.0f;
  3. Save your file in Visual Studio.
  4. Press Ctrl + Alt + F11.
  5. Once the Live Coding window says "Success," your game is already updated with the new speed value.

Best Practices for Beginners

While Live Coding is powerful, keep it simple while you are learning. Avoid changing class structures (like adding or removing variables or changing parent classes) while the game is running, as this can sometimes cause the editor to crash or become unstable. Use Live Coding primarily for tweaking logic, math, and function behaviors. If you are adding complex new assets or changing the fundamental structure of a class, it is still safest to close the editor and perform a full rebuild.

Key Takeaway: Press Ctrl + Alt + F11 to update your C++ logic in real-time, allowing for rapid iteration without the time cost of restarting the engine.