Blueprint Project Adding C++ and Compiling

[NOTE: As of this blog post, I have not tried a new UE C++ based project yet.]

     Being new to the Unreal Engine world, I found this bit quite interesting. Coming from Unity, after whatever C# code changes you make, Unity will basically compile/update automatically when going back to the Unity Editor.  For a new UE blueprint project, we need to "Build" the project in the VS editor, first, and then manually tell UE to "Live Code Update" when we make changes to our C++  code.

   For example, we could start off in a new UE blueprint project and want to make our first C++ Actor Class. So we go to the Tools menu and select New C++ Class which then brings up the new class wizard window. In the window we select Actor and then click on the next button to then give our new Actor class a name.

NOTE: This name is the actual class name that is used in C++ code in the header file and source file. So you may want to follow whatever naming conventions you like in coding. Me, for class names, I like to capitalize the first letter for each word of the name and of coarse leave no spaces here.

   Then after creating the class name, press the "Create Class" button. It will then go through the process of generating our c++ code we need. After that, it will pop-up a message telling you to close the editor and build from your IDE. Press the 'OK' button. Another message should pop-up saying that it successfully added your new class and you should recompile your '[ Your UE project's name ]' module before it will appear in the Content Browser. Press the 'Yes' button.

   After pressing the 'yes' button, the Visual Studio IDE should load up with your new C++ header file and source file ready to go. One of the previous messages from the Unreal Editor said to close the editor and build from your IDE. [NOTE: I ran across someone saying that you don't actually need to close the Unreal Editor in which of coarse made it confusing why that was said.] So, go back to the Unreal Editor, save all, and close the Unreal Editor. In the Visual Studio IDE, select the Build Menu and then select  Build Solution. [NOTE: The first time you use build, it might take a moment to build and compile everything. Later, if you made small changes. Using build should not take as long as the first time.]

[NOTE: After building the solution the first time, you can go to your project's directory and see that it added a source directory and a .vs directory.]

   Now we need to open the project. You can either go back to the EPIC GAMES launcher and open it back up in Unreal Engine->Library under 'My Projects', or go to your project's directory and double click on your project's .uproject file and it should open up. Now you should be able to see a new folder in your Content Browser call "C++ Classes". If you go in that folder and under the sub folder that should be called your project's name, you should see and icon representing your C++ class and the name of your C++ class under the icon. You can double click on it and it should open that class's source and header c++ files in visual studio. Or, you can right click on that icon to do things like creating a blueprint based on that class.

   Now we should be all set. When making small changes to our C++ code, save the code, and then come back to the Unreal Editor, In the bottom right of the editor, there's a 'Live Update' button that's between the Derived Data button and the Source Control button. You should see 3 dots to the right of the 'Live Update' button, click that and make sure "Enable Live Coding" is checked. When you press the Live Update button, a window should appear and show an output of it generating the new updated code. When it's done, it should say it's up to date or if you have any errors, it should show you them.