Need Player Assignment Not Using PhotonNetwork.Instantiate

Options
Hello, I'm Sky.

I'm new to Photon, generally new to programming. I've been working on my game in Unity for about a year and decided it was time to start my multiplayer coding.

I understand completely that PhotonNetwork.Instantiate of the player prefab is what assigns the control of the object to the player. The problem is that my scripts (and it's a LOT of code) require references to the objects they use, and every player uses the same scripts.

So say I were to make the script reference the objects in the scene that they influence, then every player would find the same object and influence it. That'd be horrible and obviously doesn't work.

Using prefabs with player-neutral scripts is a nightmare.

------------

Is there ANY other way to assign which object is the player? Could I have the player PhotonNetwork.Instantiate into an Empty Object and call it "Controller" and then have it issue a TakeOverRequest of some sorts to the player object?

Comments

  • SKyTech6
    Options
    I don't see a way to delete this post... but I actually just toughed it out and made code references to everything needed... checking player ID and then searching for different sets of objects based on ID.