Photon Server settings And Pun Rpc Broken.
Comments
-
Also. When i builded the project, I went on the editor, And there was a blank player but it was at 0.0.0, everytime it tried to move it would try to but still go to 0.0.0
0 -
How can i fix this, Any suggestion?0
-
Hi @Federico123,
Thank you for choosing Photon!
You need to fix the error
"ERROR You have missing MonoBehaviours on your gameobjects!"
You are either not attaching MonoBehaviours that implement the RPCs "networkAddMessage" to the same GameObject as the PhotonView in the scene and "DoSwapTeams" to the same GameObject as the PhotonView on the network instantiated prefab or destroying them too early.0 -
Ok, I will try to fix this and later update if it works or if not or if theres a bug.JohnTube said:Hi @Federico123,
Thank you for choosing Photon!
You need to fix the error
"ERROR You have missing MonoBehaviours on your gameobjects!"
You are either not attaching MonoBehaviours that implement the RPCs "networkAddMessage" to the same GameObject as the PhotonView in the scene and "DoSwapTeams" to the same GameObject as the PhotonView on the network instantiated prefab or destroying them too early.0 -
Didnt work. Removed the missing scripts and added the new ones and not working.JohnTube said:Hi @Federico123,
Thank you for choosing Photon!
You need to fix the error
"ERROR You have missing MonoBehaviours on your gameobjects!"
You are either not attaching MonoBehaviours that implement the RPCs "networkAddMessage" to the same GameObject as the PhotonView in the scene and "DoSwapTeams" to the same GameObject as the PhotonView on the network instantiated prefab or destroying them too early.0 -
The missing script was just some shooting thing for gunFederico123 said:
Didnt work. Removed the missing scripts and added the new ones and not working.JohnTube said:Hi @Federico123,
Thank you for choosing Photon!
You need to fix the error
"ERROR You have missing MonoBehaviours on your gameobjects!"
You are either not attaching MonoBehaviours that implement the RPCs "networkAddMessage" to the same GameObject as the PhotonView in the scene and "DoSwapTeams" to the same GameObject as the PhotonView on the network instantiated prefab or destroying them too early.0 -
this is where im getting the errors, at [RPC]
[RPC] void networkAddMessage(string killer, string killed, string middleText, string teamName){ Color killerColor = new Color(); Color killedColor = new Color(); if(rmm.gameMode == "TDM"){ if(teamName != ""){ if(teamName == rmm.team_1.teamName){ killerColor = rmm.team_1_Color; killedColor = rmm.team_2_Color; }else{ killerColor = rmm.team_2_Color; killedColor = rmm.team_1_Color; } }else{ killerColor = Color.white; killedColor = Color.white; } }else{ killerColor = rmm.team_1_Color; killedColor = rmm.team_1_Color; } whoKillWho.Add(new WhoKillWho(killer, killed, middleText, killerColor, killedColor, 30)); //Message count limit if (whoKillWho.Count > 5) whoKillWho.RemoveAt(0); } [RPC] void SendChatMessage(string text, string teamName, PhotonMessageInfo info){ AddMessage(" " + info.sender + ": ", text, teamName); } [RPC] void DoDamage(float damage, PhotonPlayer player) { if (weKilled) return; if (currentHp > 0 && photonView.isMine) { this.StopAllCoroutines(); StartCoroutine(doCameraShake()); } fadeValueB = 2; currentHp -= damage; //We got killed if (currentHp < 0) { //Deactivate all child meshes for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); } //Spawn ragdoll GameObject temp; temp = Instantiate(ragdoll, transform.position, transform.rotation) as GameObject; if (!photonView.isMine) { temp.SendMessage("clearCamera"); if (PhotonNetwork.player == player) { //Send death notification message to script WhoKilledWho.cs networkObject.SendMessage("AddKillNotification", gameObject.name, SendMessageOptions.DontRequireReceiver); //Add team score int teamScore = new int(); if ((string)PhotonNetwork.player.customProperties["TeamName"] == rmm.team_1.teamName) { //Add 1 kill for our player int totalKIlls = (int)PhotonNetwork.player.customProperties["Kills"]; totalKIlls++; Hashtable setPlayerKills = new Hashtable() { { "Kills", totalKIlls } }; PhotonNetwork.player.SetCustomProperties(setPlayerKills); } if ((string)PhotonNetwork.player.customProperties["TeamName"] == rmm.team_2.teamName) { teamScore = (int)PhotonNetwork.room.customProperties["Team1Score"]; teamScore--; Hashtable setTeam1Score = new Hashtable() { { "Team1Score", teamScore } }; PhotonNetwork.room.SetCustomProperties(setTeam1Score); //Add 1 kill for our player int totalKIlls = (int)PhotonNetwork.player.customProperties["Kills"]; totalKIlls++; Hashtable setPlayerKills = new Hashtable() { { "Kills", totalKIlls } }; PhotonNetwork.player.SetCustomProperties(setPlayerKills); } } } else { //print ("We got killed"); temp.SendMessage("RespawnAfter"); Hashtable setPlayerTeam = new Hashtable() { { "TeamName", "Zombies" } }; PhotonNetwork.player.SetCustomProperties(setPlayerTeam); //We was killed, add 1 to deaths int totalDeaths = (int)PhotonNetwork.player.customProperties["Deaths"]; totalDeaths ++; Hashtable setPlayerDeaths = new Hashtable() { { "Deaths", totalDeaths } }; PhotonNetwork.player.SetCustomProperties(setPlayerDeaths); //Destroy our player StartCoroutine(DestroyPlayer(0.2f)); if (PhotonNetwork.player == player) { //Our player fell down networkObject.SendMessage("PlayerFellDown", PhotonNetwork.player.name, SendMessageOptions.DontRequireReceiver); teamLives = (int)PhotonNetwork.room.customProperties["Team1Score"]; teamLives--; Hashtable setTeam1Score_fell = new Hashtable() { { "Team1Score", teamLives } }; PhotonNetwork.room.SetCustomProperties(setTeam1Score_fell); } } currentHp = 0; weKilled = true; } }
0 -
Hi @Federico123,
[RPC]
is obsolete. Use[PunRPC]
instead.
So replace all those occurrences and try again.1 -
Ok.JohnTube said:Hi @Federico123,
[RPC]
is obsolete. Use[PunRPC]
instead.
So replace all those occurrences and try again.0 -
It FixedJohnTube said:Hi @Federico123,
[RPC]
is obsolete. Use[PunRPC]
instead.
So replace all those occurrences and try again.0 -
But 2 bugs aren't fixed, The room bug which if i make a room my friend cant see it or if he joins in the editor his model is invisble but in his visual he is moving, the model wont move, same thing with me, he cant see me.JohnTube said:Hi @Federico123,
[RPC]
is obsolete. Use[PunRPC]
instead.
So replace all those occurrences and try again.0 -
tried fixing it, didnt workJohnTube said:Hi @Federico123,
[RPC]
is obsolete. Use[PunRPC]
instead.
So replace all those occurrences and try again.0 -
this is the script btw
https://cdn.discordapp.com/attachments/302334256951197696/629341694625710080/ConnectMenu.cs0 -
Hi @Federico123,
The issue or issues you are trying to report and describe are not clear.
I suggest you open a new forum discussion per separate issue.
And give us all the necessary information to reproduce and investigate.
The required information is listed here.0 -
Okay.JohnTube said:Hi @Federico123,
The issue or issues you are trying to report and describe are not clear.
I suggest you open a new forum discussion per separate issue.
And give us all the necessary information to reproduce and investigate.
The required information is listed here.0