How to avoid the blueprint executed in every multiplayer character?

I am not so experienced in the Unreal networking. Here is something which confuses me.

From third person template, I have two clients connected to the same dedicated server. So the two characters from the two clients can see each other on the same map perfectly. If I add a blueprint function into the character blueprint, let us say, a timer which prints a hello world message. Then you will see from each client window, two messages will print periodically. If we got three characters on the same map, then three messages at the same time.

It is not from the server, as the dedicated server was not complied with the print string test node. It seems to me that the client executes the blueprint from every character which are instanced in the view.

I guess it is basic in replication, but is there a way to avoid that? Sometimes I just want to have some functions got executed by the controlled character in the character blueprint.

I guess this is basic, hopefully someone can show me a direction…

in the actor details/Replication

tick Only relevant to owner
untick net load on client

image

Thank you @eldany.uy
But this is not working as I hoped. After those changes, the characters on the same map are no longer able to see each other, which means in every client’s view, only one character that is itself. Then surely only the blueprint of the own character gets executed, but it kind of loses the main point to have a multiplayer game as it looks totally like a single player game.

Sorry…misunderstood the question

Perhaps you’re looking for the IsLocallyControlled BP node. Use that with a branch node and you can make sure that something only executes on the controlled pawn.

The problem seems to be, that you just call the print Node… So in MP it is called on Client AND Server…
Add an SwitchHasAuthority Node before, and just call the print from the Remote (Client). This way you avoid calling the print node on th Server (Authotity), too.

As second:
Make sure to call prints on owning client only. You can set this on the initiating events start node options.

Yes, I confirm this is the way to work around, that you! @gh0stfase1

Thanks @BDC_Patrick . The way you proposed was the first thing I tried as the picture below, but not working. The problems are from the clients showing in your view. For example, if you get three clients showing in your view, all three clients are considered as Remote, the blueprint on each of them will be executed. I have tested this. Making an event of owning client will be helpful neither, the replicated clients will still execute the blueprints…

Yes… Cause BeginPlay is called on each client, for each client.
You need to setup a custom event, with replication set to owning client only.

But… I think you start with this little helper pdf:
Unreal Network Compendium

That is a really great document to read on, thanks :slight_smile: