Questions on BluePrint and C++

I have 2 questions, and any support is appreciated:

  1. Is there anything you can achieve with C++ that you cannot achieve with BluePrint?
  2. Can you create with BluePrint and C++ simultaneously on one project?

Thank you

  1. Yes, you can make much more with C++. If you want to change something that epic hardcoded into the source, you will need to use C++.
    If you want to use a function, that Epic hasn’t exposed to Blueprints yet, you need to use C++. If you want to use variables that aren’t exposed to BP,
    you will also need C++. If you want to create UObjects, you will need C++ (because you don’t have a way to create these without C++ at the moment).
    If you want to implement more feature by including several headers of others libraries, you will ALSO need C++.

Blueprints are a good base to start your adventure with, but if you have the time and will, i highly recommend you to learn C++ as soon as possible.

  1. Yes you can, if you created a C++ project, you can create variables and functions inside of your classes that are exposed to BP over UFUNCTION and UPROPERTY makros.
    You can also add code to your BP project later over “File” → “Add Code to Project…” or by righclicking the uproject file inside your project folder and choosing th same.

This is also a normal way to create your classes. Make a Base Class in C++ with all the logic and functions and create a BP of that Class without any logic in it. Now just
set the Variables like “Mesh”, “Animation Blueprint” etc inside that BP, because it is easier as getting this assets through objectfinders in C++.

If you still have questions, feel free to ask me (:

Thanks for all the info! I understand it a lot better now. Do you know where I can find the best tutorials for c++ and programming in general? Thanks :slight_smile:

:confused: No sorry. I learned C++ myself with a script from my university. By i guess you can just google a tutorial for generall c++ programming (which is good to be learned instead of only UE4 related C++).

So I guess it’s not possible in Blueprint to create a class that would encapsulate data with functions acting on this data and use this class inside another Blueprint? Ideally I would have liked to create a class, instantiate several objects from this class in the construction script of my Blueprint (passing parameters to construct my class) and call functions on these objects at runtime.

I’m fairly new to UE4 and Blueprint (but I’m an experienced C++ programmer). I must admit it was quite nice to get started. But after a while you notice things that cannot be done with Blueprints, or can be done but in a less efficient way. And when the Blueprint code gets bigger and bigger, you feel the need to encapsulate your functionnalities into classes but I could not find a way to create instances of a class with parameters. So if it is really indeed not possible, I guess it will be time to go in C++ mode…