What is the advantage of making a C++ class Blueprintable

I was looking at the source code for the Shooter Game example and I noticed that the base weapon class is defined as: UCLASS(Abstract, Blueprintable) and the two subclasses (ShooterWeapon_Projectile and ShooterWeapon_Instant) are also defined as being abstract. Given that the Blueprintable decoration is inherited, all three classes are abstract and blueprintable.

Within the Shooter Game, the weapons have either the _Projectile or _Instant classes as a parent and I was wondering why one would bother doing this. I my simple project I have a blueprint that has a ACharacter-derived class as a parent and it works fine, so what does one gain by using abstract and blueprintable if one can achieve the same results without them?

Because it is useful to be able to modify stuff in blueprints. I am not a code wizard, so my knowledge is very limited in this, though I think they explain it best in the code example.

Thanks for the reply, Motanum. I get what you’re saying, but I can do the same thing without making the C++ class abstract or blueprintable. My character class, for example, follows the Modular Pawn code example and if you look at it you’ll see that none of the meshes are defined in the C++ class; the references are set up but what the reference points at is defined in the blueprint. I’m still a noob at this so I’d like to know why Epic chose this approach so that I can learn from it. If you have any insights in this area, I’d love to hear them.

@Dijon

I think the the presence of ‘Blueprintable’ tells the UHT to add this class to the list of avilable baseclasses that you can create new blueprint from. So if you want extend this class using blueprints, you need to add ‘Blueprintable’ . The default is ‘NotBlueprintable’.

If you use ‘Abstract’ specifier, you wont be able to drag-drop an instance of this class into the editor.

mindfane,

Yes, that’s it. I was confused because the decoration “Blueprintable” is inherited by all child classes so when I saw that Epic used it for their weapon class in the Shooter Game, I didn’t follow any further up the tree. When I created my own weapon class that is derived from Actor, it does show up in the list of base classes for a new blueprint, even though it is not marked as Blueprintable. In fact, Actor class is Blueprintable, as is Pawn, from which Character is derived. In theory, with Actor marked as Blueprintable, none of the child classes require this decoration, which is why I was confused. Thanks to both you and Motanum for taking the time to reply. You put me on the right track as to where to look.