so, I just watched the video " Overcoming Early Challenges in Unreal" on youtube. Now I want to slowly port my BP code to C++. First I’d like to start with “Event Tick” on the FirstPerson character BP and rewrite the code their in c++.
I installed the latest Visual Studio and also generated visual studio project files so I can edit the code in c++.
so taking the example of the FirstPerson BP Event Tick. How would I access the same BP in c++, get to the line of code where the Even Tick starts and rewrite my code there?
Easiest way is to create a new project based on the third person c++ template and see how it’s done.
While in general I find learning c++ for unreal is a good thing, don’t do it for performance. BPs aren’t that bad. I didn’t watch the video you were mentioning but don’t believe just converting a BP project to a c++ one will drastically improve performance for your small projects.
What you would do is create a new C++ class of type ACharacter and then In your ready made blueprint go to class settings and change parent class to the C++ class you just made.
Everything goes in the direction of C++ Base classes → Derived Blueprints.
Now what ever you would write in your tick function of C++ class will run first then your Blueprint version of tick would run.
NOTE: If your current Tick function uses components that were added in your Blueprint class not in C++, then you don’t have a way to get those components in C++ what you would end up doing is using FindComponentByClass function but to be honest I would recommend if you create and add components in your C++ class as well.