Multiplayerquestion

Hi, im a newbie in ue4, i have a little confuse how this works, here is my begin play event on my playercontroller blueprint, when i play as a client, the boolean is false (it print string) but somehow the client still has the Widget (created on True branch). Can someone explain please? thanks for your time.

Hmm…I’m not super experienced with multiplayer, but I think I know this one. You can kind of think of multiplayer as a bunch of different games combined together instead of just one game.

In each game, there is one human player and a bunch of non-human puppet players that just happen to be copying exactly what the humans in the other versions of the game are doing.

As I understand it, the Is Local Player Controller node is basically asking “is it the human?” So, if you are are playing on this character/using this blueprint/etc., and an event goes through this branch node, it will always return true that you are the human in this game.

If you are trying to have something just fire on the client, you can use “is server” and the false output should always give the client.

EDIT: Oh, I see, both true and false are activating… That is strange. Do you have multiple copies of this kind of player controller in the game, by any chance? The version that is not controlled by the player would be printing the string.

Hi, thanks for replying me, i set number of player to 1 and net mode is play as client, so i think there is no other player controller. When i play as listen-server, it won’t print string ( the false branch).

When you Play in Editor (PIE) with 1 client you have 2 instances running. One is a dedicated server and the other is the client. The dedicated server is also executing BeginPlay and it returns false. The local client should always return true.
Note that if you have 2 clients, each client only see their own player controller. Only the server have all the player controllers.