Destroying a child GameObject causes parent to be destroyed.
Assume I have a Soldier prefab with a child AK-47 GameObject both with a PhotonView. If I destroy the AK-47 in master client(via PhotonNetwork::Destroy() ) , the Soldier instance in the client destroyed instead of AK-47.
From what I gathered from the code the problem stems from both the Soldier and the AK-47 have the same InstantiationId but with different subId (hence different viewIDs) but since only the instantiationId is send over network the client destroys the Soldier GO which is definitely not what is expected.
So, Is there a way to destroy the AK-47 GO without touching Soldier in this case? I might instantiate AK-47 independently than add it to the Soldier but I don't think this will be mirrored in client unless I find a convoluted way to send this information to the client and replicate there.
Thanks in advance.
From what I gathered from the code the problem stems from both the Soldier and the AK-47 have the same InstantiationId but with different subId (hence different viewIDs) but since only the instantiationId is send over network the client destroys the Soldier GO which is definitely not what is expected.
So, Is there a way to destroy the AK-47 GO without touching Soldier in this case? I might instantiate AK-47 independently than add it to the Soldier but I don't think this will be mirrored in client unless I find a convoluted way to send this information to the client and replicate there.
Thanks in advance.
0
Comments
Destroying of subobjects looks like issue in Photon currently. I hope you can avoid using it.