Issue in my 2 player co-op game with portal-style pick up system and network syncing.

So in my 2 player co-op game, the player can go over to a barrel and press e to pick it up. This then runs a function on the player script to change the position of the barrel to an empty game object in front of the player.

The issue is though when player 1 picks up and item it works for him but when the other player goes to pick up and item it works on his side but doesn't go through the network, despite both being composed of the same functions. The issue seems to be with the player instance as opposed to the object I believe.

Both players are of the same instantiated prefab with the follow scrips -
  • Photon view script
  • Photon Transform View Script
  • A sync script to disable opposite controller scripts
  • The script which runs the function to place the item being picked up into the empty game object in front of the player

While the item being has the follow scripts
  • A photon view script
  • A photo transform view script

Here's a picture of the issue in-game - https://lh4.googleusercontent.com/d5Hx-SQl4n-JjAshtvMWuu4fLmMIldThLgMJI3g8mpzoAzF77M35ZldOPc1i2y4K3pmqA7If4uWtWNTkDc9AYe6AlWEfjggTybsE8FNBXGYX-qoggVuDoJp3zlfhv6f9VE-86NtH

The components for my player - https://docs.google.com/document/d/e/2PACX-1vQaG7psuhM_ezHAGJLXObPR21xlFwD5MChw_hlNdCe2alkWsWGV5igj6R1AtEJDQ2ACunD7OhB1SaSr/pub

The components for my Items to be picked up - https://docs.google.com/document/d/e/2PACX-1vTO0EqMoP-vk21F3DJqunwbSOZZtOtSdl0UgvPUEPRy81QeWhkOCnMCpaTkkbAYxPtqrQqDl3iXyS7b/pub

I'm very new to photon so I may have left out some information so I can send on anything else required but any help would be really appreciated!

Comments

  • Thanks for writing such a detailed post.
    I can't really dive into this to help but would recommend using Simple Network Sync 2 for PUN 2.
    https://github.com/emotitron/SNS_PUN2/

    It's a syncing addon for PUN 2 and covers pickups with a few components. There is also a lot more in the package, so please make use of it, if possible.