C++ in Unreal

Would be nice if at the end of the C++ course there was a discussion how C++ is used in Unreal

1 Like

I would concur Rolf,

The section wrapped up nicely with a good foundation on the C++ language.
Considering that there are GameDev courses on Unreal that teaches you C++, it would be a cool idea to plug into their courses that way :smiley:

Thanks for the feedback!

C++ is used much in the same way no matter where it’s used. Though the functions you’ll be using will be different as it’s a different library. The goal with this course is to get the fundamentals across before diving into more complex engines and/or libraries.

That said, having a short message for where to go next would not be a bad idea!

Hey I wanted to add to this in case anyone else clicks on it. I havent used C+ in unreal but I have done a little bit of C# scripting in Unity. When youre writing code in the engine, it is really similar to what we are doing here and can change depending on your preferred programming pattern

When coding in engine, you might start by writing an event system which would be equivalent to main.cpp. You’ll also write shorter scripts which you’ll drag and drop to attach to different objects in the engine, these are similar to our base character class. Those objects refer to the scripts attached to them to determine behaviour. When code attached to an object wants to do something, it would reach out to our event system which will see it, and send it to a different piece of code which is usually another system. That system could handle damage assignments, switching the camera when you want, it could be an interaction system, or a dialogue system. Those would be similar to our custom headers and the functions in the classes attached to them.

So, if a sphere around an enemy, overlaps with the player, you can tell that enemy to draw an arrow. With this course you understand how to manually track that player with a bow, and get the vector it would need to aim a projectile from that bow to the player. In practice you dont need to know that much, but it opens up the possibility to change physics as you need it

In this course we manually did things that you would never need to worry about in the engine, but understanding how they are done gives you more freedom in engine. Being able to optimize and modify your games code through custom operations is probably the most valuable thing you can take away from this course

Privacy & Terms