Photon Network RPC Random Range Problem
Options
abidal
✭
Hi, I'm working on a MULTIPLAYER QUIZ GAME. I'm using this script for choose questions
example
player1 :question 30
player2:question 45......
I want the same question for all players .
Thanks
int indx; private void Update() if(QUESTIONS){ view.RPC("random", PhotonTargets.All); view.RPC("GetRandomQuestion", PhotonTargets. All); } [PunRPC] public void random() { indx = Random.Range(0, unansweredQuestions.Count); } [PunRPC] void GetRandomQuestion() { BarQuestions.SetActive(true); currentQuestion = unansweredQuestions[indx]; questionText.text = currentQuestion.question; unansweredQuestions.RemoveAt(indx); GetQuestion = false; }ITS WORK But every PLAYERS gets diffrent numbers(indx). How I can solve this?
example
player1 :question 30
player2:question 45......
I want the same question for all players .
Thanks
0
Comments
-
closed as it seems a duplicate of this discussion.0
This discussion has been closed.