Few question
- Is it require to place using System; on top of script in order to create a method that return string as outcome?
- Will using System stop Random.Range (0,2) from working?
- How to avoid CS0104 or in this case randomly return a String value in method?
Below are really simple script i am working on, suddenly i cannot use Random.Range CS0104 ,
"Random" is an ambiguous reference between "UnityEngine.Random" and "System.Random".
As you can see i am trying to create a method that random return ABC or AAA randomly
Please kindly advise a fix , thanks in advance!
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GSC : MonoBehaviour
void Start()
{
}
void Update()
{
}
public String StoreNameRoller()
{
int abc = Random.Range(0, 2);
if ( abc == 1)
{
return "ABC";
}
else
{
return "AAA";
}
}
Fix to CS0104 That related to using system in unity I do try according to suggestion, but then it saids System.Random.Range not exist blahblahblah