I have declared a multicast delegate in the following fashion in header file
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnActivationComplete);
class MyGame_API UMyClassComponent
{
};
It shows me the following compilation error in .generated.cpp
Use of undeclared identifer
UClass* OuterClass=Z_Construct_UClass_UMyClassComponent();
The above problems still remains but I found a workaround. If I use DECLARE_DELEGATE or DECLARE_EVENT it works on a non UClass class. It allows me to broadcast the event. The problem that I am having now is listening the event in my Actor sub class.
I tried using AddRaw(this, &MyActorSubclass::MyFunction) - but it fails with ‘no such method definition for AddRaw’. I dont understand why this fails to compile?? (MyFunction is not a UFUNCTION).
Can someone please let me know the correct way of achieving this?
I also tried AddSP() but unfortunately TSharedFromThis is not allowed on Actor sub classes. So cant use this.
EDIT: Updated the question with my most recent findings.