Now, If I want to add another weapon into the game (for example, a shotgun), should I create A NEW blueprint class for every weapon I’m gonna add into the game?
I’d like to use my Blueprint Class for every weapon I will add without creating a new copy.
Generally it is a bad idea to try and keep all the different weapons in the same blueprint. Imagine you have 10 different weapons. Now imagine that each of those has a lot of special behaviour that the others don’t have. That’s a whole lot of special cases which would blow up the blueprint’s size and make it unreadable and un-maintainable.
It is a better idea to gather all the properties and behaviours your weapons have in common and create a blueprint for it. Then you derive each specific weapon from that blueprint and only add in the special behaviour for each specific weapon. Certain problems might also be easier to solve by using a blueprint interface.
But, does it exist a “c++ version” of my blueprint class?
For example, the screen above represents my blueprint: it has an event tick linked to an AddActorLocalRotation
Had I wanted to do the same thing the blueprint does BUT in C++… how?