Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Invalid Cast Exception Error : Right After Photon.Instantiate ?

$
0
0
Hi Fellows,
I am getting error when Photon.Instantiate called. It is okay when i assing Photon.Instantiate group parameter as 0.
But if i do set group parameter differenly. I am getting InvalidCastException: Cannot cast from source type to destination type.
Output Below :
InvalidCastException: Cannot cast from source type to destination type. NetworkingPeer.DoInstantiate (ExitGames.Client.Photon.Hashtable evData, .PhotonPlayer photonPlayer, UnityEngine.GameObject resourceGameObject) (at Assets/_External/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3070) PhotonNetwork.Instantiate (System.String prefabName, Vector3 position, Quaternion rotation, Int32 group, System.Object[] data) (at Assets/_External/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2493) OnJoinedInstantiate.DoStuff () (at Assets/_External/Photon Unity Networking/UtilityScripts/OnJoinedInstantiate.cs:48) OnJoinedInstantiate.OnCreatedRoom () (at Assets/_External/Photon Unity Networking/UtilityScripts/OnJoinedInstantiate.cs:23) UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions) NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/_External/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2706) NetworkingPeer:GameEnteredOnGameServer(OperationResponse) (at Assets/_External/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1229) NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/_External/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1797) ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[]) ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() PhotonHandler:Update() (at Assets/_External/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)

And thus command line cause error : inside internal GameObject DoInstantiate method.
byte group = 0; if (evData.ContainsKey((byte)3)) { group = (byte)evData[(byte)3]; }

have a nice work.

Best Regards ,
Oguzhan

Viewing all articles
Browse latest Browse all 15755

Trending Articles