Help bridging the gap between using C++ and Blueprints together

Hey all, this is my first post here, I’m completely lost trying to figure out how to utilize C++ alongside Blueprints and I would really appreciate any recommendations for learning resources.

I come from Unity and I’m used to programming everything using C#. I know how to use C++ and I’m trying to make a game in UE4 and was told that 100% C++ isn’t the way to go and it’s better to mix in BP with C++; at least like 70% C++ and 30% BP (I’m a programmer, so I’d like to code more) but I’m having issues understanding how to use BP alongside C++ and I was wondering if anyone knew of any good resources to help bridge the gap between C++ and BP.

I more or less get how C++ works with UE and how BP work with UE but when I try combining the two of them I’m really lost.

Lately something I’ve been having an issue with is loading the main player asset into the scene, I saw that there was a way to do that with BP (a preferred method actually) but it hasn’t been working out for me and then I realized that loading up the asset doesn’t even work out because the player start isn’t set to the asset because player start is set to the default sphere pawn and it’s just things like that that have been getting me down lately. I know I can build this game in UE, I’ve just been having a hard time finding a resource that will help me bring everything together.

Here is my take on it.

I completely agree with the 70/30 ratio. C++ is awesome for keeping the project re-usable clean and has fewer bugs than Blueprints. So I use it as much as possible, but it also has drawbacks, it takes time to compile and sometimes requires editor restart (bummer).

So I use C++ to do the backend of the whole class and expose just “fun” little functions that are mainly visual. Let me give you an example, I want to make player glow when he takes damage. So I would do all the damage handling in C++, and expose “StartGlowingAfterHit” to the blueprint, where I can easily play around with Timelines, how much it glows, maybe adding a slight delay before glowing etc. etc. Because blueprint takes not time to compile, I can see it right away.

If you are asking technically “How”. Then creating UFUNCTION(BlueprintNativeEvent) void StartGlowingAfterHit() is the trick. Since the Blueprint is just a child class like any other, this will allow you to override it in the Blueprints!

Onto the Main player asset into the scene, I am not 100% sure what you are trying to achieve here, but GameMode->Default pawn is probably what you are looking for.

Hope this was useful!