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:
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.
answered Sep 29 '16 at 02:04 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here