Download

Learning Unreal C++

Hello Community!
Im struggling on learning Unreal C++.
I have C# experience in Unity, but Unreal C++ seems to be more difficult.
I’ve done most of the C++ Unreal Tutorials.
I have the issue that im searching 1 hour only for fixing an easy mesh renderer component initialisation.
I dont want to post every problem i have, because i always have to wait for an answer.

Now to my Question:
How do you guys learned Unreal C++? And is there maybe a chat where i ask questions spontaneously?

I learned UE4 C++ with Google IIRC. On mobile right now so I typing is unpleasant, but if you need help in the future, www.reddit.com/r/unrealengine usually has faster response than the forums, and if you message /u/kowbell I check my inbox fairly regularly.

Anyway, you’re looking for a UStaticMeshComponent and the CreateDefaultSubobject function.

In your .h, put


UPROPERTY(BlueprintReadWrite, Category = "Mesh") // This line exposes your variable to the editor.
UStaticMeshComponent* MyStaticMesh;

In your .CPP AYourActor::AYourActor() function, put


MyStaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Static Mesh"); // this is how you initialize components in UE4.

Set the actual mesh in the editor. Its infinitely easier.

If you need further explanation for anything, again, I’d be glad to help!

Hey there!

Actually, as I see it, there are two places to get started with UE C++: here and here (look for the C++ category)

Where did you start? In order to learn UE C++ I started with the Blueprints Basics actually and then watched the C++ video with blueprints. I did not stop with just Blueprints, I dived deeper into animations, materials, construction script and whatever core concept the UE may make use of. In my opinion, the first step to make when learning to use a library (or the engine in this case) is to read and understand all the relevant concepts that the library introduces and uses. You should always know what you write your code for. I spent quite a lot of time on this first step since the engine is quite elaborate. This also helps a lot to prevent bugs and errors that are caused by inappropriate use of the concepts provided and enhances greatly the proccess of designing and engineering software and algorithms. This page helped me out quite a lot with that goal. Just follow the layout of that page. I actually did not read beyond the framework yet, since I am still at the step below.

After having a “profound” understanding of the framework and concepts, I started learning about the C++ that was used to implement these. I referred to the documentation (and I must say: I love it! Even if unrefined, it already does a good job of providing deeper understanding). This is the main page you will want to refer to: https://docs.unrealengine.com/latest/INT/Programming/index.html
I admit that I did not find out about that page by myself but was directed to it by fellow community members during twitch streams.

I follow(ed) the following path when reading the docs:

  1. https://docs.unrealengine.com/latest/INT/Programming/Introduction/index.html
  2. https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Reference/index.html
  3. https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/index.html
  4. Whatever you wish. Since you should already have a solid foundation by now it should not matter.

All that should be left now should be advanced topics such as AI behaviour trees, localization, networking etc. But I plan to learn these engine features once I have gotten far enough to put them to use. Also: You will find a lot of tutorials and How-To’s when you explore the links I posted above. Even if you do not watch them immediately, I recommend you to keep track of them and to remember that there are tutorials to particular features and concepts. This will help you out a lot once you get started! Another thing to mention: There are many tutorials from users at the wiki as well. This might proove useful in some cases as well: https://wiki.unrealengine.com/Category:Code or https://docs.unrealengine.com/latest/INT/Programming/Tutorials/index.html or in general: https://wiki.unrealengine.com/Main_Page

I am not done with my course yet as well, but since the engine is so big I chose a path with which I could get started quickly and dive deeper later. I would never skip the step of understanding the framework though!

I hope this proves useful to you :smiley: If not share your thoughts, it might improve my guideline as well.

PS: There is a Blueprint to C++ conversion tool in work and it seems to be almost ready. That will help a lot with learning UE C++ as well in my opinion, since you can always prototype your code with BP and see how the staff implements it in C++. See here: Trello

Do you know C++? If not I would start there. There is no Unreal C++ variant. It’s just a game engine written in C++. If you understand C++ it’s very easy to navigate the class hierarchy. I also find that in general any questions I have about how to do something whether specific to Unreal or general to games, graphics or C++ have already been asked and answered on the net somewhere.

If you don’t know C++, I’d strongly recommend getting a book on C++ and working through it cover to cover. Understanding C++ fundamentally will save you a raft of time and headaches in the long run.

Depending on how proficient you are with programing languages, it might suffice that you simply look up the differences of C# and C++. I bet you will be able to find enough resources on the net therefore. I didnt read them but maybe these two pages can get you started:

https://msdn.microsoft.com/en-us/library/yyaad03b(v=vs.90).aspx

Digging through the ShooterGame sample project (from Launcher) and Survival Series (GitHub - tomlooman/EpicSurvivalGameSeries: Third-person Survival Game for Unreal Engine 4 (Sample Project)) really helped click the network side of things.

And people don’t recommend going network first, but by understanding the network side, I got a better feel of how different things should work together (such as Player State, Controller, Character/Pawn, Game Mode, Game State, Game Instance, etc.) even if I were to build a single player game. I had built some prototype single player games in the past but when you’re doing single player you can kind of stick things anywhere and the game is still able to function in a cohesive state. If you do that in network you’ll run into trouble. It was nice to figure out WHERE things actually SHOULD go.

Unreal being open source is great. It’s helpful to see the engine source locally when debugging, and browse on GitHub when the general documentation for a function is lacking.

Most examples of how to do something are Blueprint based. I’ve found the C++ translation is usually annoying to figure out but in the end is mostly 1:1.

Thx for the replies! You guys are really helpfull :slight_smile:
@Kowbell didn’t thought about reddit. I will try it!
@rYuxq i’ve done most of the Tutorials already, but i think i also do some blueprint tutorials, so i get a better feeling at coding in Unreal. Thx for this link https://docs.unrealengine.com/latest/INT/Gameplay/index.html this will help me definitly!
@DEFNIQUE I have experience in C, C# and Java. But i just doesn’t come along with the class descriptions within the Unreal Documentation.
@zerosum0x0 I also wanna build an Network game, so Thx for the Link!