Search Unity

Third Party I have a bug where all instantiated objects are controlled by everyone connected to server (PUN)

Discussion in 'Multiplayer' started by jtonkeys, Dec 4, 2021.

  1. jtonkeys

    jtonkeys

    Joined:
    Dec 3, 2021
    Posts:
    1
    So I have the player controller being instantiated at runtime after connecting to the master server, yet somehow everytime I connect a new client to it, the most recent connected client controls all movement in other clients. WASD works across clients but continues to control all other instantiated objects, ie player controllers. How do I fix this, I have been trying for two days with tons of combinations & cannot figure it out. Attached is the instantiate script after connecting to master server & also the photon scripts on the player controller. Thanks
     

    Attached Files:

  2. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    Sounds like you are missing an IsMine check on the player controller. You didn't include that code, however.
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066