Hi everyone, im using PUN v 1.66 and im getting this error message in player 1(master client) when a second player has his bullet being destroyed.
The game is a gunbound style game. When I have just one player in room(unity editor), I shoot a bullet and it gets destroyed using:
In Bullet.cs
void OnCollisionEnter(Collision collision)
{
if(photonView.isMine)//PhotonNetwork.isMasterClient)
{
Debug.Log("destroying bullet: " + photonView.ownerId);
PhotonNetwork.Destroy(photonView);
}
}
This works well, no error messages. Bullet gets destroyed.
When I add a second player, and is this one (android device) who shoots, I get error message on first player(unity editor MAC OSX):
Ev Destroy Failed. Could not find PhotonView with instantiationId 2003. Sent by actorNr: 2
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2013)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)
So, it seams player two tries to destroy photonView while it(bullet) is already destroyed, how can I prevent this?, what does photonView.isMine means in this context?, Im new on photon pun, still getting to know how all this works. Regards,
BTW, I tried posting this question in thread:
http://forum.photonengine.com/discussion/comment/28113/#Comment_28113
as it was related, but got no answers, so Im doing it here.
The game is a gunbound style game. When I have just one player in room(unity editor), I shoot a bullet and it gets destroyed using:
In Bullet.cs
void OnCollisionEnter(Collision collision)
{
if(photonView.isMine)//PhotonNetwork.isMasterClient)
{
Debug.Log("destroying bullet: " + photonView.ownerId);
PhotonNetwork.Destroy(photonView);
}
}
This works well, no error messages. Bullet gets destroyed.
When I add a second player, and is this one (android device) who shoots, I get error message on first player(unity editor MAC OSX):
Ev Destroy Failed. Could not find PhotonView with instantiationId 2003. Sent by actorNr: 2
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2013)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)
So, it seams player two tries to destroy photonView while it(bullet) is already destroyed, how can I prevent this?, what does photonView.isMine means in this context?, Im new on photon pun, still getting to know how all this works. Regards,
BTW, I tried posting this question in thread:
http://forum.photonengine.com/discussion/comment/28113/#Comment_28113
as it was related, but got no answers, so Im doing it here.