Troubleshooting
Compiler errors
If you receive this compiler error:
Assembly has reference to non-existent assembly ‘PhotonRealtime’ (Assets/Opsive/UltimateCharacterController/Add-Ons/Multiplayer/PhotonPUN/Editor/Opsive.UltimateCharacterController.AddOns.Multiplayer.PhotonPUN.Editor.asmdef)
Ensure you have imported PUN 2 from the Asset Store. This compiler error:
Assets/Opsive/UltimateCharacterController/Add-Ons/Multiplayer/PhotonPUN/Scripts/Game/PunObjectPool.cs(138,47): error CS1502: The best overloaded method match for `Photon.Pun.PhotonNetwork.AllocateViewID(Photon.Pun.PhotonView)’ has some invalid arguments
Indicates that you are running an older version of Photon PUN. Ensure you are running version 2.13.
Player doesn’t join an already created room
Ensure you are connecting to a server within the same region as the room that is already created. You can force Photon to connect to a specific region by setting the Fixed Region of the Photon Server Settings.
Unable to Spawn Object
If you receive the following error:
Error: Unable to spawn name on the network. Ensure the object has been added to the PunObjectPool.
The object needs to be added to the PUN Object Pool. See the Scene Setup page for more details.
Object Location/Active State Not Synchronized
If the object position/rotation or the GameObject active state is not being synchronized over the network then the PunLocationMonitor component should be added. This component will allow the object to be updated by the owner and the results will be sent to the other clients.
Object Not Sent over the Network
If you receive the following error:
Error: The object name does not contain a PhotonView or ObjectIdentifier. It will not be able to be sent over the network.
Photon is not able to uniquely identify the object in order to be sent on the network. This can be fixed by adding a Photon View or Object Identifier component to that object. If the object is a scene object then the PunObjectIdentifier should automatically be added after the scene has been setup.
Large Scene Positioning
The NetworkCompression class will compress the position vector of the character for more efficient transmission. If your scene uses positions larger than 1,000 units the FloatToShort compression variable should be updated to reflect the max possible position.