I have this code:
chknext = Random.Range(0, 6);
int checkmonspawn()
{
getrannum = Random.Range(0, 4);
if (getrannum == chcknext)
{
getrannum = Random.Range(0, 4);
}
return getrannum;
if getrannum and chcknext is the same, getrannum will get another random number. Problem is sometimes he gets the same number What is the efficient way to do this?