Spending all day looking at my c++ codes and unreal engine errors yesterday, I finally narrowed down to 2 lines of code that might need some changes. I believe this question doesn’t require my entire c++ code.
What I intended was:
If player(self) implements CInterfaceActorManager, call ActorInRange function.
This function is in the CInterfaceActorManager interface.
But I’m not sure GetOwner()->GetClass() gives me ‘Self’(in blueprint terms).
Implementation of interfaces is all done by blueprints.
There is Implements<T> shortcut nowadays in UObject.
Your original syntax is the proper one for blueprint-implemented interfaces, you must use Execute_ prefix method.
The one thing that is wrong is, you are checking if the OWNER implements interface, but calling interface function on this object.
Either you want to call function on the owner :
if (GetOwner()->Implements<UCInterfaceActorManager>())
ICInterfaceActorManager::Execute_ActorInRange(GetOwner(), CurrentLoop);
Or you want to call function on the current object (self) :
if (Implements<UCInterfaceActorManager>())
ICInterfaceActorManager::Execute_ActorInRange(this, CurrentLoop);