Combine C++ and blueprint in character

I want to create my character logic (e.g. control, shooting, inventory etc) via C++ and add actors to my character via Blueprint. (I inherit blueprint from my character class.)

Example to explain what did I mean:
I have Camera attached to socket on my skeleton mesh’ head (first person view). Also I have Camera attached to spring (Third person view). I watch several tutorials and I think there is two ways:

  1. Add all components via blueprint editor. It is very useful to set position, rotation and sockets for my components. But this class is inherit, so I can’t access my cameras and other components from C++ base class.
  2. Create all components in C++ class constructor using CreateDefaultSubobject, position and attach they manually. It’s useful to access them from C++, but it’s a bit uncomfortable to set all positions, socket names etc in code, instead using GUI.

Is there any way to combine this two ways? Maybe some virtual methods to setup parameters (e.g. socket names) from Blueprint Editor?

you can make the class in C++, and add the components using the CreateDefaultSubobject, and then at bp side, you can still add few more components. Adding components in C++ doesn’t mean you can’t adjust their position in the blueprint editor. Nope. Once you donce from the C++ class, go ahead and make a bp based on it. And then inside the bp choose (open full blueprint editor) and there you are free to move and adjust parameters of the inherited components.

regarding the camera thing, you can add camera in BP, and at the beginning of the game, you do blend to it from the inherited C++ camera.

I used what you talking about here, in creating the character controller for this book. Not only mixing C++ and BP in terms of components, but also in terms of functions.

-m