I’m using UE 4.12.5. The same version as in the video but I could not find the method with the given name/signature. Probably it’s related to the fact that I’m doing the course much later that the video was recorded. I don’t know. Here is what I can see in VS:
I’ve found a way to use the add method like this:
void UTankTrack::BeginPlay()
{
FScriptDelegate ScriptDelegate;
ScriptDelegate.BindUFunction(this, FName("OnHit"));
OnComponentHit.Add(ScriptDelegate);
}
I don’t know if it’s the intended way to generate OnHit events but it works for me.
Actually the following code works as well. I’m just a bit hesitant to use the function that is prefixed with __Internal. It looks like they don’t want the clients to use it directly.
OnComponentHit.__Internal_AddDynamic(this, &UTankTrack::OnHit, FName("OnHit"));
What do you think of the FScriptDelegate approach? Am I doing things correctly here?