I am a programmer and I have created a AWeapon base class, where I have defined all the behaviour . Then, I can create a c++ derived class, for example AShotgun, and only change variables in the AWeaponClass. It is not needed to write more code, only to change variables default values. I have found that I can create a Blueprint child class and it becames DataOnly. My question is, I loose all my perfomance if I create a DataOnly blueprint, or because it is only changing variables it will be the same as good perfomance as it would be if it would be a c++ class? Because it is more artist friendly if I can use a Blueprint DataOnly without loosing perfomance.
If your logic is in the C++ class, the performance will be the same. The data that is took from the “Blueprints Data Only Default Values” (<- :O) is only taken when spawning.
Spawning is a pretty heavy thing itself, but that’s out of question here. So yeah, you are fine to do that and i would recommend everyone to do this.
Creating Base classes in C++ and just having a “visual” data only Blueprint where you set up the Model, fill in variable etc is a really good way to work.
Thanks you very much!!!
In my experience the only “real” performance difference between BP and C++ is with heavy calculations (complex algorithms, recursive functions) and heavy tick scenarios.
Just calling functions on collision etc. is negligable. So e.g. adding a OnBeginOverlap event in BP and in C++, assuming they both just set some bool, will be identical in performance.
Exi, and how about not using just the data only blueprint and editing scale and mesh positions? Does that cause any issues?