Now,I am not sure if I got it right from the tutorial,but my understanding was that suffixing the method with _Implementation means it is overridable by the blueprint inheriting from this class.I created a blueprint that inherits from LightSwitchBoth and added OnComponentEndOverlap event.But it doesn’t override the C++ event.It causes the light to become invisible which means it calls the default method anyway.So I probably missed the idea.Anyone can explain what’s going on here?May be _Implementation means the default C++ method does get called with the blueprint adding extension to it?
When implementing a method in a class via native code (C++ using the _implements function) or via a blueprint you are implementing the method for the given class. Like in any OO (Object Oriented) programming paradigm a class as one an unique implementation, the specialization comes from their inherited classes.
In your case I would suggest to create a child class in blueprint and override the method as a blueprint function, you also have to call the supers (the parent class) function which will be the C++ implementation.
As a working example I just created a new project using one of the templates, the sidescroller template in my case. I added a implementation of ‘CanJumpInternal_Implementation’ as shown in the following snippet:
class AMyNiceCharacter : public ACharacter
{
GENERATED_UCLASS_BODY()
protected:
// Overriden from ACharacter to provide double jump functionality
virtual bool CanJumpInternal_Implementation() const override;
};
And then implemented the function in its cpp file:
Now back in the editor I created a Blueprint inheriting from my class and I took the following steps to implement the event on the blueprint side too. Note that if I do not call the super function I will break the call chain.
But that’s what I am doing.I am extending the class via BluePrint.How do I override that method in blueprint?By creating new method with the same name via “new function” ?Also what is the difference then if I drop _Implementation suffix?