Should i create blueprint out of c++ class that i have created ?

Hi everyone i know Blueprint system well , now i want to create new project in C++ i heard a lot of people create blueprint classes based on those they created in c++ is it necessary or could i just use C++ for everything since Blueprint classes are much slower due to virtual machine. Ps sory for my english

Hi,

mostly you create blueprints from c++ classes. when you create a blueprint you can choose your c++ as the parent class. Set up static meshes, spheres etc and game play logic in c++ and expose certain variables to blueprint and you will be able to change their values in blueprint

best regards, Peter

Personally I would suggestion that it is best to use c++ when it is absolutely requried or when you sure that a code block is slow in blueprint.

Also keep in mind that for some classes if you rename or move the parent c++ class, the blueprint which inherit from that c++ will get corrupt and you will not be able to open. If you have half the logic in bp this will be an issue.

Thanks

So for example i create character in C++ and give him all component and those component i should make BlueprintReadWrite then place blueprint on the level and work from there right? so then if i create Enemy and his logic should be programed in regard to that C++ class or the Bp i placed?

that is good tip. i want to make as much in c++ as possible cuz i want to work in gamedev and other engine propably won’t have BP like system. If i made game in UE4 based on C++ it would be great addition to my IT degree.

I keep nearly all logic in source and expose variables to blueprint in order to tweak them without closing and recompiling every time. You only need to create a blueprint derived from your code if you want to modify exposed/create functionality quickly without creating another C++ class, or if your just not fast enough at coding.
You could create a project entire in C++ afaik but you would have to recompile your source for every little change.

C++ does the heavy lifting while blueprint adds small changes and pretties it up. That’s how I tend to use them.

EDIT - saw new reply

Your Enemy in the level will perform its C++ logic, plus any changes you have added into the blueprint. If your code has a function that moves the Enemy forward Var=10 units, the class will move forward 10 units. If you derive a blueprint class and set Var=5 in blueprint, your Enemy will move forward 5 units.

Specifiers are useful for coupling C++ and blueprint functionality

https://docs.unrealengine.com/en-US/…ers/index.html
https://docs.unrealengine.com/en-US/…ers/index.html

i know that but that does not answer my question . Let say i programed enemy to follow something should i tell him to follow that C++ class or specyfic BP Cuz if i can made many BP based of that one class how it would be able to know which to follow (remember i just started to learn codding in UE4 )in BP i can cast like this:

All you need is a reference to the object, you don’t need to worry if it’s C++ or BP. If your blueprint enemy is in the level and you iterate through all the actors to get your enemy actor, you can use that in code just fine.

I am having trouble understanding what you’re asking here. Deriving many blueprints off a C++ class is just like deriving many blueprints from a single blueprint class.
Hopefully I understood the last one.

Sory I’m not native english speaker and it is 3:30 AM in Poland . I will just dowland UE4 sample projects and check it how is it made there to get better understanding what you said thank you .

At the bottom of the main page are categories for other regions. Have you asked in the Central Europe category? Sorry I could not understand clearer. Maybe try to reword it differently.

https://forums.unrealengine.com/international/central-europe

I always Make Blueprint Out of my Base C++ classes.
Reason behind that is BP’s are super Game Designer Friendly and easy to manage and If I can I always make all of my C++ Classes Abstract.
Epic Staff also advises the developers to put all the Tick related Code into C++ as it is more performance friendly, I Personally do things like Timelines and Animation classes Inside Blueprints.

1 Like

Yes it is good thinking to have a bp derived from C++ as stated by many in this thread.
Some nodes are much better done in bp as they are very easy to author (as opposed to C++) and likewise, some are better done too in C++. One of the reasons is the C++ code can be very simple and performant.

I also do not like having bp derived from bp as you have to manually call the parent bp when you override the node eg beginplay. It is prone to error and doesnt look very neat.