How do I separate players for controlling something?

Options
This feels like a super rudimentary problem, so I apologize for my noobness, but I have a working multiplayer lobby and game where each player has a spaceship. The problem is that each player can control EVERY ship in the scene. I'm trying to figure out how to separate them.

I assume I need to add a "if this is your ship, then you can access these controls" but I can't seem to figure out how to assign each instantiated ship with its own unique player/ownership tag that can be reliably checked against. That way I can lock out controls on all the other ships. How can I check, upon spawning a new ship, who instantiated it? If I can answer that question, the rest will, hypothetically, domino into place.

Thank you

Comments

  • MEH_Robson
    Options
    You need to attach to your spaceship Prefab PhotonView if you haven't done it and in code set a reference to it and implement
    if (photonview.IsMine)
    {Your controls}
    
  • Darknuke
    Options
    That was easy lol. That worked flawlessly. Thank you!