Player won't instantiate from some reason
Options
Hello, sorry if I'm writing to wrong section, but anyway I can't instantiate player on network.
This is my script to connect:
using UnityEngine;
using System.Collections;
public class NetworkManager : Photon.MonoBehaviour {
public Transform respawn;
private const string _VERSION = "1.0";
void Start() {
PhotonNetwork.autoJoinLobby = false;
PhotonNetwork.ConnectUsingSettings(_VERSION);
}
public virtual void OnConnectedToMaster() {
PhotonNetwork.JoinRandomRoom();
}
public void OnPhotonRandomJoinFailed() {
PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 4 }, null);
}
public void OnJoinedRoom() {
Debug.Log(Resources.Load("Player"));
PhotonNetwork.Instantiate("Player", respawn.position, respawn.rotation, 0);
}
}
Using Debug.Log(Resources.Load("Player")); I've found out that it finds Player. But it won't instantiate. Any idea why?
This is my script to connect:
using UnityEngine;
using System.Collections;
public class NetworkManager : Photon.MonoBehaviour {
public Transform respawn;
private const string _VERSION = "1.0";
void Start() {
PhotonNetwork.autoJoinLobby = false;
PhotonNetwork.ConnectUsingSettings(_VERSION);
}
public virtual void OnConnectedToMaster() {
PhotonNetwork.JoinRandomRoom();
}
public void OnPhotonRandomJoinFailed() {
PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 4 }, null);
}
public void OnJoinedRoom() {
Debug.Log(Resources.Load("Player"));
PhotonNetwork.Instantiate("Player", respawn.position, respawn.rotation, 0);
}
}
Using Debug.Log(Resources.Load("Player")); I've found out that it finds Player. But it won't instantiate. Any idea why?
0
Comments
-
Is anything in the Console?0
-
The only thing it writes is:
Operation failed: OperationResponse 225: ReturnCode: 32760 (No match found). Parameters: {} Server: MasterServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1146)
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:92)
But I've created another project, used the script above, created folder Resources, placed a Capsule prefab in it and it works just fine (even when it writes this message in the console). Then I've replaced Capsule prefab with the prefab from original project and it also works. So now I have like no idea where can be the problem...
Also I forgot to mention that it instantiates Unity's default 3rd person controller character with its scripts.0 -
i'm getting the same error since i downloaded the last update, i tried
PhotonNetwork.ConnectUsingSettings("v0.0.1");
PhotonNetwork.CreateRoom ("asd");
Debug.Log (PhotonNetwork.inRoom);
but then it returned i'm not in a room. Along with the error bondy posted, pls help T_T0 -
And also, if i select "Best region" under photonserversetting. it shows
Authentication failed: 'Cloud Public / Region au is not available.' Code: 32756 UnityEngine.Debug:LogError(Object) NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1186) ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[]) ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
0 -
In case i messed up the sourse file, i imported pun again in a empty project, and ran the demos after setup, but none of them works.
The steps i did in setting up are:
1. put down appid
2. close setup wizard.
3. Go to photonserversetting, click on autojoinlobby, switch to best region.
Is there anything i did wrong?, pls help0 -
Though this error i got in another project too, but there it works. Even with this problem.0
-
@libra34567: Can you try to select a specific region in the settings, please?
You get the issue 'Cloud Public / Region au is not available.' when you run a demo with "Best Region" in the Editor?
Would Australia (AU) be the closest region to you?0 -
Alright, so I've solved my problem with instantiating. The problem was, that it was looking for prefab in Resources folder inside of PUN/Demos folder - there was 2 folders named Resources in my project.
And btw I've changed region to EU, but I still got the error in the console.0 -
@Tobias , yes, i'm living in AU, when i select AU, or best region, it pop up that error, but when i select EU, its fine0
-
and i got this error when running demo: (and 225)
Operation failed: OperationResponse 227: ReturnCode: -1 (Unknown operation code 227). Parameters: {} Server: MasterServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1146)
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)0 -
What is application type you are trying to connect to au? Not all products supported in au, Chat does not have au servers e.g..0