Asymmetric behaviour when using P2P (and more)

Hi,
I’m working on a multiplayer game using P2P but I’m having some issues with creating a player for every game instance and syncing the players’ positions.

Here is everything I already looked at:

Here is the part of the code that creates the players (ignore the floorchek objects for now):

The idea is to distinguish the players by assinging the client ID to them. (Initially the object variable ID is “n”.) I tried it with 2 players (on 2 separate computers), and while in the client’s game two players were created, in the host’s game there was only one.

But that’s only half of the problem, because when I move the player in the client’s game, the other one moves with it as well, but nothing happens in the host game. And similarly, moving in the host game has no effect on the client.

Here is the code for the controls (again, ignore the floorcheck, I know it’s wrong, but let’s just focus on the left-right movement first):

And after this, I update the position of all players:

I’ve been staring at this for the past week but I just can’t get it to work so any ideas are welcome.

I don’t know a ton about how p2p works, but one thing that I think you’re missing is a unique identifier for each player. It might explain why both players move in the client. You said the initial client ID is “n”; is it n for both of them? The debugger also helps for checking what variables are being sent between game instances.

@Heat_Miser I see your point, but then how can I set a different value for the newly created player without changing the already existing ones?