Bug 4.13 - NetMulticast function executed on unrelevant clients

I’ve created a character that override this function “IsNetRelevantFor”, this function works perfectly.

The problem is this, when I execute an event net multicast this function is executed on all clients either on the clients where the actor is not relevant. The actor becomes visible for 2/3 sec then will be destroyed because is not relevant…

As you can see in the Video each time I press the left mouse button the NetMulticast function (EVENT_OnFireTriggerPressed) is called either on the left side where the character should be unrelevant. After 2/3 sec the character will be destroyed.

This is the code:

bool ATestCharacter::IsNetRelevantFor(AActor const * RealViewer, AActor const * ViewTarget, FVector const & SrcLocation) const {
	if (this == ViewTarget) {
		return true;
	} else {
		return false;
	}
}

The NetMulticast function is:

Header:

UFUNCTION(NetMulticast, Reliable)
void EVENT_OnServerFireTriggerPressed();
void EVENT_OnServerFireTriggerPressed_Implementation();

CPP

void ATestCharacter::EVENT_OnFireTriggerPressed_Implementation() {
	if (ROLE_SimulatedProxy == Role) {
		bIsFireTriggerPressed = true;
	}
}

Hey ,

Thanks for the feedback. I was able to recreate the issue and have submitted a issue report for it. You can follow it here:

https://issues.unrealengine.com/issue/UE-36139

Thanks for the support

This is happening to me on 4.18.3 in blueprints

It happens when I set the visibility of a component on a character, specifically my overhead chat widget. When I multicast to all, then run a server RPC and use rep notify to set the chat component to visible for 10 seconds, all characters all over the world see the chat component for 2 or 3 seconds before it disappears, while those nearby see it for the full 10 seconds.

This is present in 4.20, and only seems to affect Reliable multicast functions. Actors becoming relevant even for a few seconds is quite expensive as well.

Thanks for the update… looking forward to seeing this addressed.

If you need the functionality of a Reliable NetMulticast, a quite simple workaround for now is to loop through each PC on the server and call a Client RPC on them that performs the functionality you need, filtering the owning PC of an owned actor if needed, etc. Doing this and avoiding reliable multicasts cut down my games network usage quite a bit.