When the server (which is also a client) check the “IsLocallyControlled” node, he never returns true. So he never send his position to the other clients but can see them moving around. I figured this out threw severous logs and print string. Is it normal? Am I missing something? Thanks for the answers guys. Cheers.
Ah, right. My mistake, what you want to check for is the NetMode and see if it’s the listen server as only the listen server can have a local client in addition to being the server.
if (GetNetMode() == ENetMode::NM_ListenServer || IsLocallyControlled() )
Unfortunately this produces the same effect as your previous proposition. I want the code to execute only on the calling controller. With this, if the client calls, the server AND the client execute it.
Ok so after hours of fighting i figured it out. You just can’t call this function on beginPlay, apparently the server needs some time to connect the player controllers, so just do it after a delay
Thank you for this, I have been stuck on this for hours trying to figure out why “IsLocallyControlled” works everywhere else. Now I know it is because it is BeginPlay.
8 years later, you are still helping people out lol