Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

Unreal Engine 4 C++ Tutorial

In this Unreal Engine 4 tutorial, you will learn how to create C++ classes and expose variables and functions to the editor.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/185-unreal-engine-4-c-tutorial

Tommy, thanks for great tutorial. It is easy to follow yet easy to learn.

I noticed following comments regarding blueprint subclass of a C++ class: “If you’ve created a subclass, some properties won’t change even if you’ve changed it within the base class.”. But the more annoying this is that the subclass generated after change will reflect changes. This sounds like a potential developing hazards to me. I guess it is due to a difficulty piping C++ changes into blueprint but I feel like its potentially a deal breaker if I want to mix c++ and bleuprint classes. I guess it depends on what of properties “some” properties are. Can you give us pointers to what these properties are ?

@tommytran Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi Kim,

From what I’ve tested, variables you create will update if you change them in your C++ constructor. However, if you have overridden them in Blueprints, they will retain that value.

Component variables seem to be different. If you change them in the C++ constructor and recompile, they will not change. However, if you restart the editor (full recompile), they should update to the new defaults. What’s confusing is that a component still may not update even after a full recompile and I’m not sure why this happens.

Note that all of this is only what I’ve gathered from my limited testing.

1 Like

Thanks Tommy.

I also notice adding C++ class seems to be limited in certain projects only.

I currently have a blueprint only ue4 project. But when I tried to add C++ class via extending Blueprint static function library, it just does not bring up VS solution to build. It just bring up UE4 solution to “analyze code”.
And then it just doesn’t to anything to the project, it seems.

@tommytran Can you please help with this when you get a chance? Thank you - much appreciated! :]

That’s strange. You should be able to add C++ to any project. I just tried creating a fresh Blueprint project and was able to add a C++ class based on UBlueprintFunctionLibrary (it opens the VS solution as well).

Try to see if you can recreate the issue on a fresh Blueprint project.

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]