C++ Server functions can only be called by the owner

I have created a simple “server, client” function and it works fine. For instance, if i have this “server, client” function in a pawn i was possessing and i called it, it would work fine. But if i have the same function in an actor and i called the “server, client” function from my pawn it doesn’t work? For some reason i can only call the function within that actor and not across actors, this i a problem for when my player is holding a weapon. I cant call the “server start fire” function from my pawn!

Is there any solution to this

AActor::ServerStartFire()    // i CANT call this function from another actor,
{
       //Call client function from server
       ClientStartFire();
}

AActor::ClientStartFire()
{
       //Do stuff that replicates to all clients
}

Hi, for Server-Client, if you already have UFUNCTION(client) then ClientStartFire_Implementation() will be run on client when you call ClientStartFire on server, so you need to put that in your cpp.

Same for Client-Server, you need YourFunction-Implementation() in your .cpp

Did you read “Requirements and Caveats” in https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Replication/RPCs/index.html ?

Also checkout this Question:
https://answers.unrealengine.com/questions/161378/rpc-never-being-called.html#answer-161393

As you said in the title “… can only be called by the Owner” but do you call AActor::SetOwner(AController) somewhere?

Oh, the problem was that my actor didn’t have a set owner. I’m trying to figure out how to set it because

CurrentActor->SetOwner(this);

Doesn’t work?