Hi guys:
I am now making a network game, each local player will have 3 weapons, and each weapon will correspond to a controller. And the last controller controls the movement of the player. Hence, Each local client will have four player controllers. I add these controllers in the following diagram:
Now I am using UE4 networking to make a networking function. But the server generates four Character images for every client, when the client connects to the server. I don’t know why. Maybe it’s because the client has four controllers or something. I have no idea. Please tell me the reason and how to deal with the problem. Thank you very much.
I’m pretty sure you’re only supposed to have 1 player controller for each client.
No, I have 4 player controllers per client, so that I can have splitscreen play in combination with network play, and this works very well. I have had 3 vs 3 matches with 3 people on each of two devices on the same LAN network.
If you Create a Player on the server, it will receive a playercontroller and an index >= 0.
However, on the remote clients, any playercontroller that is not owned by the client’s device will have an index of -1 (from the client’s perspective), which means that for the non-server clients, player controller indexes will all be 0, 1, 2, and 3 for local players and -1 for remote players.
Do you want to have 4 pawns on each client? If so, why do you not want to have them appear for everyone in the game?
If there is anything you don’t want to exist on all machines in the game, you should not replicate those actors, and only spawn them on the machine that they should exist for.