Playing with one Server and more than one Client, all clients above the first can´t move
so my real big Problem is that when i´m testing with more then 2 Players the second and third client (and above) are not moving (only the Player can´t move, the RTS cam works great), but i can rotate them. I´ve tested it in editor mode and in Standalone, its not working. And here comes the strange thing for me: When i´m testing in editor and try to debug, i select in the Player Blueprint one Client and then lookin at one of the Players for debugging, and then suddenly the first Client can´t move (still only the Player Character) and the other client can move run jump, whatever he wants. And after switching to another Player or client for debugging everyone can walk run jump and so on.
Gamemode_Main: Handle Starting Players
Function: Increase Player Count
Gamemode_Main: Spawn Players and get the Reference to the owning PlayerController_Main
Function: Spawn the Player and RTSCam
PlayerController_Main: Getting the References of the Player and RTSCam
Sorry for the Big Question :D
asked Jan 21 '17 at 05:54 PM in Blueprint Scripting
Hmm. That's a lot of stuff. Are you aware that every client sees his own first player controller as player controller 0?
answered Jan 21 '17 at 07:03 PM
Does Anyone know what the Problem is? I really can´t find the solution for this.
answered Jan 24 '17 at 03:15 PM
I found that the server always assigns remote players an index of -1, even if I explicitly set their index on the server to something else, it reverts them to -1, and the only players allowed to have a non negative-one index are the players that live on the server itself.
To get around this problem, I make any remote procedure calls that have to match a local playercontroller to its server equivalent (which are NOT the same object it turns out, because playercontrollers don't share across machines like pawns do), then I have to pass the PlayerState's Player Id variable into the RPC and loop through all the player controllers, fetching their playerstates' Player Ids and seeing if it matches. When I find the match then I tell it to do the action on THAT player controller.
So if you can avoid doing anything that has to match playercontrollers across machines, that's better than what I did, but I had to do it at least once after they join the server in order to match up the splitscreen players' preferences and assign them correctly. After that I don't have to mess with it very much.
answered Mar 14 '18 at 05:44 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here