Passing pointers to RPC

Hi there! I have a short question. How do pointers behave in the RPC? I’m a little confused. Example:

void AMyCharacter::Event()
{
	MulticastCallback(this);
}

void AMyCharacter::MulticastCallback_Implementation(AMyCharacter* _Owner)
{
	if (_Owner == this)
	{
		UE_LOG(LogTemp, Warning, TEXT("_Owner == this"));
	}
}

I’m running server+client mode. Why when I call a custom event from the server and pass a pointer to the current object to the RPC, I get _Owner==this twice? Although I expect this to happen once when the server itself does it.

Pointers to replicated actors are translated into the unique ID of the actor, sent across the network, and then the same actor is looked up on the other side.

1 Like