I need help for c++ and bp

Hello guys! I need some help, I started learning UE5 9-10 months ago, I am medium level in BP.
Now I want to learn C++, they want C++ for work, of course I will continue to learn BP. But I don’t know where we can learn C++. Can you recommend me a decent source? In the UE5 documentation, it appears to be compatible with 4.27. Would it be a problem to look at it from there and do it? And do I need to learn a C++ library? I don’t know anything. Sorry for my bad english.

First learn C++ without the game development aspect. There are many good sources to learn C++ out there online whether it be YouTube videos or websites. Here is one I recommend: https://www.learncpp.com

1 Like

The way Unreal Engine uses C++, it’s a bit different than normal C++.

Here are a few tips to keep in mind after you learn C++.

Constructors for UObject derived classes are not used in the typical C++ way. They are instead used to setup CDO (Class Default Object).

This is basically a dummy class instance that is built as the default object for that type. Then all other instances of that class are copied from the CDO.

Inside constructors for CDO, you use CreateDefaultObject instead of NewObject. This is useful if you build default components in your actor for example.

In Unreal Engiene, instead of static_cast or dynamic_cast, you use Cast<>.

Learn how UPROPERTY macro works.

Learn TObjectPtr in Unreal Engine (and how smart pointers work in C++).

Don’t use STL in Unreal Engine (though you technically can do it, but avoid it when you’re starting out). Instead, use the Unreal Engine containers TArray, TSet, TMap.

A typical scenario in C++ is to derive the AActor class (or ACharacter) with your own custom class. Then you can create a Blueprint that derives from your custom class. You can then have access to everything in your class from the blueprint. This is where reparenting BP comes in handy.

Anyhow, these are things I wished someone had told me what I started out. Hope these help. Keep a note of them for later once you’re more familiar with C++.

edit: Oh, forgot to mention Unreal Engine has a garbage collector. All members of UObject derived classes are garbage collected, not just PROPERTY’s. Use TObjectPtr whenever possible to be safe.

2 Likes

Thank you. Right now, I’m learning normal C++, that is, c++ oop and I learned the basics, I can do simple applications with loops and so on. I will look at what they say in the future, I think it’s early for now