Possible to add code to existing Blueprint Class?

Pretty simple question: is it possible to add C++ code to an existing blueprint class, and if so, how?

What is your use case? Is there something you want to speed up?

You can add C++ components to blueprint actors, or make a BlueprintLibrary in C++ and call functions from your blueprint.

My primary reason for wanting this is so I can modify blueprint variables in code, but I figured if Unreal supported it, it’d be a good thing to know regardless.

There is a difference between extending blueprints using C++ and accessing blueprints using C++ :wink:
You should be able to and write the value of a blueprint variable from C++. I don’t exactly know how.

However, I think it is probably cleaner to just write an interface in C++ and let the blueprint class implement the interface.
Or you can use a C++ base class and extend that in blueprint.

I would also be pretty interested to see if Unreal Support the option of adding c++ to an existing blueprint class.

I currently trying to add C++ from the TopDown Character to a really complex character blueprint (That does not have any C++)

Hey Chuckleluck-

It would depend on exactly what you mean by that. Simply adding code to an actor blueprint doesn’t work. If you have a blueprint based on Actor/Character/Pawn/etc and you want to add code, you would have to edit the engine source file for these classes. If you have a blueprint based on a custom class that has been added to the project, any change to the parent class needs to be compiled and will then be available in the child blueprint.

Cheers