Error CS0104: 'Random' is an ambiguous reference between

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Threading.Tasks;
using System.Drawing;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using System.Text;


public class fouroperator : MonoBehaviour
{
    public UnityEngine.UI.Text firstNumber;
    public UnityEngine.UI.Text operatour;
    public UnityEngine.UI.Text  sappend;
    public UnityEngine.UI.Text sesult;
    public UnityEngine.UI.Text secondNumber;
    int number1;
    int number2;
    int oper3;
    int islemSonuc;

    // Start is called before the first frame update
    void Start()
    {
        number1 = Random.Range(1, 10);
        number2 = Random.Range(1, 10);
        oper3 = Random.Range(1, 4);
        switch (oper3)![U333333ntitled|690x296](upload://zQMNMctU6k0rcY6sIboXkuK7knN.jpeg) 
        {

            case 1:
                operatour.text = "+";
                islemSonuc = number1 + number2;

                break;
            case 2:
                operatour.text = "-";
                islemSonuc = number1 - number2;
                break;
            case 3:
                operatour.text = "*";
                islemSonuc = number1 * number2;
                break;
            case 4:
                operatour.text = "/";
                islemSonuc = number1 / number2;
                break;
}
        firstNumber.text = number1 + "";
        secondNumber.text = number2 + "";
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void answer()
    {

        if (int.Parse(sesult.text)== islemSonuc)
        {
            Console.WriteLine("TRUE");

            

        }else
        {
            Console.WriteLine("FALSE");


        }
    }
}
strong text

Hi Eno,

Sorry its taken so long for me to find this post.
there is a post about it here,
https://community.gamedev.tv/t/im-having-a-problem-with-random-range/153927/2

it looks like theres a Random class within
using UnityEngine
and
Using System

so its not quite sure which one to use.
hope that helps.

DaZ

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms