Function executing twice?

I’ve been having this weird problem while trying to work on a small project to get my feet wet with networking. Unfortunately I seem to be running into what I suspect to be a simple problem, but I’m not experienced enough to make heads or tails of it.

Right now I have a player controller class ASurvivalRPGPlayerController that has the following action input on left mouse button:

void ASurvivalRPGPlayerController::ActionEventMouse1() 
{
	if (Role == ROLE_Authority) 
	{
		if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "MOUSE 1 PRESSED");
	}
		
		if (PlayerRef) PlayerRef->ServerTriggerInteract();
}

The problem is that MOUSE 1 PRESSED appears on the screen twice, regardless of the number of clients (I’m using a dedicated server.). This propagates down to any additional functionality that I call as a result of the click (as in my object interact functionality alluded to by the last line).

The weird part is that, when I switch the Role check to ROLE_Authority instead of ROLE_AutonomousProxy, no messages show up at all. This is behavior I would only expect if there is no authoritative version of a player’s SurvivalRPGPlayerController actor.

What gives? Can anyone explain why this is happening and what I can do about it?

EDIT: For Content

An Update: I have confirmed that each one of these two messages come from an instance of the game that has the Role_AutonomousProxy. What I don’t understand is why one of these is not an Authority, as from what I understand there is one copy of the controller on the server (always) and then there is a local PlayerContoller actor. I still don’t understand why this is happening.

Epic are very stupid human. Go to Unity.

I didn’t personaly met anyone from epic but they got better engine than unity.

You can change anything, you got better performance, more updates a lot of futures which are far from unity. It’s currently the best engine.

I have used both but it’s huge difference. I would say switch to unreal.

Hey,

Read here:

Documentation:

Answerhub question same as yours (simpler)