Photon Network RPC Random Range Problem

Options
Hi, I'm working on a MULTIPLAYER QUIZ GAME. I'm using this script for choose questions
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

Comments

This discussion has been closed.