C++ and the Unreal API

Of course, I’d fall in love with Unreal as a C# programmer. I mean, who doesn’t want to take the most difficult path to everything, am I right? Since I refuse to let my obsession of Unreal go away (primarily due to its volume effects and lighting/sky system), I had to dive into their API trying to understand the architecture. Thankfully, the basics of C++ and C# aren’t that different. That wasn’t the case when I went from Lisp to C#. That alone puts me light years ahead of where I was when I started with C#. For example, I didn’t expect to be able to understand the tutorial I followed to construct a C++ Unreal project with a pickup system and custom blueprint in a matter of a few hours.

The system I constructed involves a C++ project using the First Person Template. The person walks around picking up industrial-like barrels. I began the project using Unreal Engine 4.22. Since the tutorial I found was about four years old, the code had to be modified/corrected due to API changes over the years.

industrial barrels

The first step was to generate a new class in the editor.

editor

After that it was a matter of locating the correct classes to include and adding the text in the below images to the header (.h) and cpp files.

header

cppfile.JPG

In a few hours, I completed the task I set out to do and am confident that I can dive and start to push things considerably further. It took me a few years with C# and various APIs before I got to that same level of confidence. Since I can’t up and quit my career to find a mentor, I pursue this stuff on my own.  Because of that, I was hesitant to dive into something new. Now, I’m more excited than ever to figure out the API behind Unreal.