Hi guys!
I'm slowly losing my mind trying to solve a problem I encountered about three days ago. The problem is something like this: I'm making a multiplayer shooter, in my own (I mean, not the one that stands by default, but the one that you create yourself) The game instance contains a data structure with three variables, one of which is an integer.
This structure is permanently saved through the save game actor.
When two clients start the game (play standalone), they open a menu with a section on weapon customization, respectively, the Game instance contains an array of weapon classes (we'll call it the Weapon array), and in the UI, when choosing a weapon, we set the integer value from the structure to the Game instance and save the structure.
Let's say I have two child classes of weapons lying in the array - MK-18 and M4A4.
Next, one of the clients creates a session (there is a classic system with create session) and gets to the level. There, in the player, a weapon will spawn from an array identical to the array in the Game instance (and next are the modules for it, but that's not important right now), But then, when the client connects to the session (and he has already chosen another weapon for himself, for example, if the server player chose the MK-18, then the client player chose the M4A4) and essentially the same thing happens, the weapon spawns, the tricks begin.:
Basically, it looks like the weapon on the client looks like the one it should be, but on the server it is displayed as the weapon chosen by the player by the server (that is, let's say the server chose MK-18 and the client chose M4A4, then the client displays M4A4, and the server displays that the player has both MK-18 players)
I am aware that the game instanse is the same for both players when starting the editor, and perhaps that's the case, but when starting the standalone game, the problem has not gone away, can you tell me what the problem is and how it can be solved?
Thank you very much in advance!
Top comments (0)