Client becomes Master when entering the room, only on iOS, Any ideas?

Options
I'm using UFPS and the UFPS Multiplayer Kit, the problem I have is that when a client enters the room the game crashes for the master only, everything works as expected on the client (now new master), in other words it can only be one master and it will keep crashing if someone else enters the room, the problem it only appears on apple devices, I mean Mac (while testing in Unity) and iPhones or iPads, on Android everything works, as well as on PC. Here are the console errors:

NullReferenceException: Object reference not set to an instance of an object
vp_BodyAnimator.InitMaxSpeeds () (at Assets/UFPS/Base/Scripts/Gameplay/Player/vp_BodyAnimator.cs:823)
vp_BodyAnimator.Awake () (at Assets/UFPS/Base/Scripts/Gameplay/Player/vp_BodyAnimator.cs:310)
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
vp_MPPlayerSpawner:InstantiatePlayerPrefab(PhotonPlayer, Hashtable, Int32, Int32, Int32, Int32, Int32) (at Assets/UFPS/Multiplayer/Scripts/Master/vp_MPPlayerSpawner.cs:401)
vp_MPPlayerSpawner:ReceiveInitialSpawnInfo(Int32, PhotonPlayer, Vector3, Quaternion, String, Int32, Int32, Int32, Int32, Int32, Int32, PhotonMessageInfo) (at Assets/UFPS/Multiplayer/Scripts/Master/vp_MPPlayerSpawner.cs:311)
System.Reflection.MethodBase:Invoke(Object, Object[])
NetworkingPeer:ExecuteRpc(Hashtable, Int32) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3022)
NetworkingPeer:RPC(PhotonView, String, PhotonTargets, PhotonPlayer, Boolean, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3831)
PhotonNetwork:RPC(PhotonView, String, PhotonTargets, Boolean, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2941)
PhotonView:RPC(String, PhotonTargets, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:597)
vp_MPMaster:TransmitInitialSpawnInfo(PhotonPlayer, Int32, String, Int32, Int32, Int32, Int32, Int32, Int32) (at Assets/UFPS/Multiplayer/Scripts/Master/vp_MPMaster.cs:709)
vp_MPMaster:RequestInitialSpawnInfo(PhotonPlayer, Int32, String, Int32, Int32, Int32, Int32, Int32, Int32) (at Assets/UFPS/Multiplayer/Scripts/Master/vp_MPMaster.cs:657)
System.Reflection.MethodBase:Invoke(Object, Object[])
NetworkingPeer:ExecuteRpc(Hashtable, Int32) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2999)
NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2592)
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:153)

I'm not sure, but I think the problem starts with this function:
NetworkingPeer:ExecuteRpc

Any ideas why it doesn't work on iOS?

Thank you



Answers

  • Hi @Pepe,

    the error states a NullReferenceException which is related to an object that gets created before. This object has a vp_BodyAnimator component attached. Its Awake gets called which calls a function named InitMaxSpeeds. Within this function the exception is thrown. Since this is working on some platforms but not on all paltforms, I would check if there are different prefabs used first to see if those are set up properly. Afterwards I would try to Debug the mentioned line in code on the non-working platforms to see what possibly is wrong.

    Since this isn't one of our Asset Store packages, we don't have any further insights about this, means that we can't do any more precise or detailed support for this. If you can't fix this error on your own, I would recommend you contacting the developers of the package and ask them for help.
  • Oliver
    Oliver
    edited May 2018
    Options
    Hi @Pepe

    Did you manage to make it work? Maybe I can help you with this. Do you have any other errors in the console?