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