- Home /
Unity multiplayer quiz game,how to get the same question on both?
Hi all, I'm making multiplayer quiz game now .
I use PUN2 ,and both can get into the same scene.
Because I not good at use MySQL or other database , so I store the questions with JSON.
If I don't use the database , can I let the both to get the same qusetion?
Currently, I try to use PhotonNetwork.IsMasterClient to check, but it can't work.
Can someone give me a suggestion? Thank you !
public void RandomRound()
{
if (PhotonNetwork.IsMasterClient)
{
randomNum = Random.Range(0, 69);
randomChNum = Random.Range(0, 10);
quizCon.index = randomNum;
queChinese.index = randomChNum;
}
else
{
clientNum = randomNum;
clientChNum = randomChNum;
quizCon.index = clientNum;
queChinese.index = clientChNum;
}
}
What do you use for synchronization at the moment?
I don't use anything for synchronization.
So why don't you read the documentations provided by photon? when starting a networking based project you should know what you are doing before you actually do it seriously.
Answer by Captain_Pineapple · Oct 30, 2019 at 10:44 AM
Read into RPC's. Synchronize the questions number using a RPC or synchronize the random generators seed at startup to generate the same random numbers.
I don't realize clear after read file. When I should use RPC? When the serve send the message to every client?
Your answer
Follow this Question
Related Questions
Photon - How to name a player? 0 Answers
Photon : Multiplayer car race game Camera Set 0 Answers
Photon Network Muzzleflash 0 Answers
Photon Unity multiplayer player name issue (worldtoscreenpoint?) 0 Answers
Developing for multiple platforms 2 Answers