- Home /
Multiplayer Problem
Ok guys im back with another problem
ok so recently i started making a multiplayer game with Photon Cloud everything worked normal even multiplayer with my brother :D ok so then i realised that when i play the sit animation the camera is where it was when i was standing so then i realised that i had camera attached to the first person controller or my player so then i attached my camera to the head of the player ok my player scripts are made like so Camera,playermovement,characterController are disabled on the start so i don't controll other player when i play on lan but as soon as i attached the camera to the head it stopped working. when i play the game i get black screen (what means that the camera didn't enable on the start..) :( it should enable the camera as soon as the player spawns as so with the other scripts i don't know if its wrong with the camera or script but i really need to have camera attached to the head So please if someone had the problem and he solved it if he can help me whit this im realy bad with scripting :P
Lp Tone20
I'm not entirely sure how you made all that work if you're "bad" at scripting :p. As friendly tip, when you run into issues dealing with scripting make sure you provide the script in question as we can only take a guess at what the problem may be if we can't see the script.
Answer by tone20 · May 14, 2014 at 07:08 PM
Ok yea so when you mentioned about how i made the script all i did was folowing the tutorials from this guy https://www.youtube.com/user/quill18creates Thats the problem im having CLICK THE LINK
Friendly tip, there's a comment button under every response please use that ins$$anonymous$$d for comments. The field at the bottom of the page is designated for answers only, not comments.
Ok, so in your video I noticed there is a null reference exception that occurs when you hit play once you've moved the camera under the head object. Click on the red text at the bottom of the Unity editor and post the error it describes in the console window here (as a comment please, lol, no more comment answers).
NullReferenceException: Object reference not set to an instance of an object Network$$anonymous$$anager.Spawn$$anonymous$$yPlayer () (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/Network$$anonymous$$anager.cs:125) Network$$anonymous$$anager.OnJoinedRoom () (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/Network$$anonymous$$anager.cs:106) UnityEngine.GameObject:Send$$anonymous$$essage(String, Object, Send$$anonymous$$essageOptions) NetworkingPeer:Send$$anonymous$$ono$$anonymous$$essage(PhotonNetworking$$anonymous$$essage, Object[]) (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/_I$$anonymous$$PORTED/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1616) PhotonNetwork:JoinRandomRoom(Hashtable, Byte, $$anonymous$$atchmaking$$anonymous$$ode) (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/_I$$anonymous$$PORTED/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1295) PhotonNetwork:JoinRandomRoom(Hashtable, Byte) (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/_I$$anonymous$$PORTED/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1265) PhotonNetwork:JoinRandomRoom() (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/_I$$anonymous$$PORTED/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1251) Network$$anonymous$$anager:OnJoinedLobby() (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/Network$$anonymous$$anager.cs:94) Network$$anonymous$$anager:OnGUI() (at C:/Sites/$$anonymous$$ultiFPS - ep 14/Assets/Network$$anonymous$$anager.cs:62) O$$anonymous$$ This is the Null reference and here is the code that enables the main camera (($$anonymous$$onoBehaviour)myPlayerGO.GetComponent("$$anonymous$$ouseLook")).enabled = true; (($$anonymous$$onoBehaviour)myPlayerGO.GetComponent("Player$$anonymous$$ovement")).enabled = true; (($$anonymous$$onoBehaviour)myPlayerGO.GetComponent("PlayerShooting")).enabled = true; myPlayerGO.transform.FindChild("$$anonymous$$ain Camera").gameObject.SetActive(true); } }
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
How to connect to hosted scene (Multiplayer) 2 Answers
how to test your multiplayer game 2 Answers
How to make GUI update for all players in a networked game? 1 Answer
setup a php master server 2 Answers