when i pickup a item , the function OnPickUp is called , the item is detroy and a message appear in the game . but the blueprint override is not call.
if i make a link between "Event Destroy"and “Play sound at location”, this work so is not a blueprint probleme.
I Have found there is a certain methodology to the madness when it comes to using UE4. Because of the layers of indirection between the C++ code you write, the the C++ code generated by the UBT, to the way blueprints implement things can get a bit confusing. The first and foremost is I do not think your PickedUp_Implemented is marked virtual in your A.h class and I don’t think you can mark it virtual either. This is most likely why your changes are not being called.
How I would solve this is to create a function in your base class A.h
Now if you need to implement something new in C++ in your B class you can override the PickedUp function.
B.h
virtual void PickedUp() override;
implementation
void B::PickedUp()
{
// Do Custom Stuff here
// Call Super::PickedUp()
// Or do custom stuff here
// Or forget Super and just call OnPickedUp() it's protected after all
}
I have a bit of an Update to this, while this method works you may be able to specify that a Function_Implementation is virtual afterall. I stumbled across a UFunction specifier called CustomThunk Through some random sequence of events I learned that UE4 calls the generated _implementation functions “thunks”. Unfortunately I do not know more than this but figured it may be useful to you to play round with.
Function void A::OnPickedUp(); is virtual. If it wasn’t
void B::OnPickedUp_Implementation() override; would not compile as You cannot override non virtual functions