- Home /
Photon - better understanding on who owns what?
I need a better understanding on how to know who owns what. the view ids as far as I can tell are being set to the first person that joins. But how can I allocate view ids to certain people. How can I find a player by a view id. For instance I have a bullet prefab that gets instantiated when you shoot. I'm not giving it a network view, but I'm having it find A player that has my playerhitscan script then sending out rpcs through that script which is on a player that gets photon instantiated on start. But I don't at the moment know how to specifically have the bullet find that script by the master player or whoever i want it to. So far I'm using GameObject.Find("PlayerHitscan").getComponent() which will cause a lot of lag for shooting. I need to know how to ID players and find scripts by certain players and have the player im looking for cached already etc...
For instance I find myself doing GameOject.Find("Player") when I need to know how to find a specific player not a gameObject.
Thanks in advance.
I'm not sure I follow. You're not using PhotonViews on the objects? I think you should be. Then, whenever you hit something, just get it's PhotonView to access it's ID. If you need a table of players>viewIds then curate it when the players dis/connect.
Your answer
![](https://koobas.hobune.stream/wayback/20220613125515im_/https://answers.unity.com/themes/thub/images/avi.jpg)