- Home /
Photon Network Cant Destroy Player Objects
Hi all!
I instantiated some players with photon network. If a player kills another player, it's destroyed only on killer's screen. I tried to use RPC as
GetStabbed gs = GetComponent<GetStabbed>();
if(gs!=null){
PhotonView pv = GetComponent<PhotonView>();
if(pv==null)
Debug.LogError ("FREAK OUT!!!!!");
else
gs.GetComponent<PhotonView>().RPC("Die",PhotonTargets.All);
}
But it didn't work as i hoped. Die function is [RPC] but still i cant destroy them on network. I was trying to destroy them as standart Destroy(gameObject) then i made a search about photon and i found some PhotonNetwork.Destroy(gameObject); method.
It worked perfectly for passive enviroment objects! But not for players. When i try to kill another player it gives an error as
Failed to 'network-remove' GameObject. Client is neither owner nor masterClient taking over for owner who left: View (0)1001 on MyPlayer(Clone)
But both players dont kill each other. First I thought i'm killing the masterClient and someone has to take over the masterClient state but no one can kill anyone. Please help I'd be very grateful! Any help would be appreciated!
Your answer
Follow this Question
Related Questions
Photon Network Cant Destroy Game Object In All Clients 3 Answers
Getting an "Unknown Resolve Error" with Photon.MonoBehaviour 1 Answer
How to Destroy Game Object In All Clients in Photon Network 0 Answers
Photon Networking - What function(s) are called when a player (not me) is spawned? 2 Answers
Sending (and receiving) player names with Photon Networking 0 Answers