Add C++ code to my BP project?

Hello,

I created a Blueprint 3rd person project, but I need to use C++ for some things (remapping keys in-game).
Is it possible to add C++ to my BP project?
I don’t want to use the 3rd Person C++ template because I prefer to have all the game logic in Blueprints, only things I can’t do in BP have to be in C++.

Thanks for answers!

You should be able to use the “Add Code to Project” option under “File” in the editor. This should generate the required project files to add code to your existing project.

some things to bear in mind working with source code…

  • The leters in front of classes are important U for Uobjects, A for AActors… F for the rest…
  • you can add items via visual studio BUT beware of the location … default location is something with …/intermediate… it must be “Project”/Source/“Project”
  • the name.generated.h include must be the last

Should I create the header file .generated.h ? I do not find it when I add code to the project using the c++ wizard. Please help

No, it’s generated by UHT when you build.

Do I need to download all the source code of UE4 to be able to add simple C++ code like the original poster is asking?

No. A build installed from the launcher will already have the source code and libraries required for you to build C++ based projects.

In 4.8 I don’t see this option. Can I get an update on where to find this?

You should be able to find “New C++ Class” under File instead of “Add Code to Project”.

Is there a way to undo this? I have added 1 small function to my project this way, but I wish I hadn’t - it’s a hassle everytime I upgrade Engine version… can I clean it up somehow and remove that code?