Download

C++ class and Blueprint class - they are not the same?

I understand how work with Blueprint class - in Viewport we’re creating complex object from many simple objects and after that we’re using Blueprints nodes to did something. But in C++ class we have only code, no viewport. I know how to create simple objects from C++ (I mean creating subobjects), but for creating complex objects it’s pretty hard, isn’t it?
For example - I want to make a door. I have a door frame and door objects. I create new blueprint class, in viewport I’m placing objects and after that starting coding blueprint nodes for adding some functionality to that class. But I’m stuck with making something similar in C++ class. Placing door and door frame together from code? It’s not the best way, I guess?
I know that I can make a complex Blueprint class and after that add C++ component to that, but I guess it’s not the best way of doing that, am I right?

Here I’m stuck. I created Blueprint class with some functionality, and after that I’m trying to re-create similar actor but with C++ class. But placing objects from the code sounds like a bad job. Maybe I missing something? Maybe I must use C++ class only for logic?

It sounds like you are answering your own question really, you are pointing out how to use them together.

You can make a new Blueprintable C++ Base class that will have code in it, then rebase your Blueprint Class to have the C++ as the parent. They work well together.

If you want to place all the objects from C++ only, you can do that in the constructor, but you don’t have to, instead you can place them in the Blueprint.