- Home /
Network just for 2 player
i make 2 buttons ( create room and join room ) and 1 textfield (player name). i have problems :
in "void StartServer", i success to pass player name to static variable roomname and playername. but in "void OnServerInitialized" i have debug.log something, it always run 3 times whenever in runtime. why?
my plan is make 1 scene for create/join, 1 scene for lobby, then 1 scene for the game itself. i can make it to show 2nd scene from create/join scene. but what variable must i pass to 3rd scene to make sure the 2 players can play the network game? and how to pass those variable?
thx in advance for the response.
Some code would e nice, but ill see what I can do. It sounds like you may be making an RPC call for StartServer, true? If this is the case this would be incorrect. Ill elaborate after you respond. Secondly, to have players switch from one level to another, you require an RPC call. Your best bet is to have the server call for a level change, then send an RPC to .Others(Buffered) which would call a function specifically meant for changing levels. Note: when changing levels it is I$$anonymous$$PERATIVE to change the levelPrefix http://docs.unity3d.com/ScriptReference/Network.SetLevelPrefix.html
Your answer
Follow this Question
Related Questions
Simple Multiplayer Animation Question 1 Answer
Network RPC buffer issue 0 Answers
How to use Network.Instantiate Groups 1 Answer