Correct usage of "Is locally controlled" in Character? [4.8.3, Blueprints]

I want to initialize my Pawn/Character. Some things for the locally controlled Character, like creating a HUD. On the other hand some things for all but the locally controlled, like setting their mesh’s material to enemy or friendly colors and creating a healthbar over their heads.

At first I tried setting up everything in Event BeginPlay, but that was problematic since “Is locally Controlled” did not work as expected. (Always returning false, for details just search here for “locally controlled”)

I worked around it with a Delay, but Delays might (and did) not work everytime and I like to do it the correct way.
I read about the problem and found out some ppl have the same problem. And I seen many “dirty” solutions like the Delay and some which sounded cleaner.

What I tried:

  • I tried to work on “Event Possessed”, but this is only Serverside, I need to do have it executing on the server and on every client.
  • I tried to reliably multicast the “Event Possessed” to all clients, but this would again only work if I inserted a Delay. With no delay it would only reach the server.
  • I tried to work on “Event OnPostLogin” from within the GameMode, “Get Controlled Pawn” from new player, casting to my character, then sending a reliable multicast custom event. But this only landed on the server. A Delay right before the multicast brought it to work, but again “Delay”. [1] [2]
  • I tried to use a “DoOnce” in “Event Tick” on the Character, but sometimes it did not work either, local Player did not know that he was the local player.

This is not really a good situation. I think every new developer will stumble upon this non-obvious behavior when using “Is locally controlled”.

  • I would like to have a “Everything is set up, Begin Play”, now comes my logic and the engine has set all it needed to set.
  • I would like my Character to Tick on the Controlling Client only since he knows that he is in control.
  • Alternatively having a “OnPostLogin” in GameMode that can multicast to all the clients.
  • Alternatively having a “Event Possessed” in Character that can multicast to all the clients.

Essentially the current state means; I can’t make descisions in BeginPlay and I need to break out of Tick as long as Im not sure if everything is set up.

Sidenote: using a “Run on owning Client” instead of a Multicast from “Event Possessed” worked, but it did not solve my setup needs for all the non-local clients (creating healthbar, setting colors) since the message is not transmitted to them. This even fixed "Event Tick"s behavior of not knowing if it is locally controlled AFAICT.

UPDATE to Sidenote: AND it fixes “BeginPlay”, the local client knows who he is, if there is a “Run on owning Client” executed before, even if it does nothing… strange.

[1] Ryan Gerleve: Is Locally Controlled returns True for remote players? - Multiplayer & Networking - Unreal Engine Forums

[2] Ben Halliday: Is Locally Controlled function returns false on client's controlled local pawn - Multiplayer & Networking - Unreal Engine Forums