BlueprintNativeEvents cannot be made virtual, an error message suggests otherwise.
This means they can't be overridden in C++, unless Unreal does some seriously stupid language hacking, in which case this should be documented, but here are the entirety of the docs pages on BlueprintNativeEvent:
So, in short, either the error messages are misleading -- which is a bug, hence this being a bug report -- or the documentation needs to be updated -- which I'm considering a bug so I don't need to file this in two separate places, which would probably just be irritating for everyone. Either that or I'm missing some annotation which allows a method to be overridden in both C++ and Blueprints, without having to make separate, extra methods to wrap both and do some fancy logic of my own, since the only reason I'm using Unreal instead of writing everything from scratch is to get that kind of repetitive stuff taken care of for me.
asked Jun 23 '17 at 06:24 PM in Bug Reports
If I understand correctly you are trying to create a function that can both be overridden in a class blueprint as well as a child C++ class, correct? This is possible with the BlueprintNativeEvent specifier and _Implementation functions. Consider the following declaration:
The BlueprintNativeEvent is what allows the function to be overridden in blueprints and the _Implementation is the default code that is called if it is not overridden in blueprints. To be able to override this in your child class, you will need to make the _Implementation() function virtual (
This would allow you to implement the function both in your parent and child C++ class, and override them (independently) in their respective blueprints.
answered Jun 30 '17 at 08:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here