Looking to generate a random float but random.range doesn't work since "you need to specify System.Random()
or UnityEngine.Random()
". When using System.Random as shown it says "non-invocable member "Random" cannot be used as a method", even though it should be. UnityEngine.Random()
is a weird device which messes up other random values I'm looking at doing later on. Getting real sick of unity, program makes simple coding so difficult.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
//using System.Random;
public class idk : MonoBehaviour
{
public float john = 0f;
public float epic_gaming = 0f; //time variable
public int gaming;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
epic_gaming += 1;
if (epic_gaming == 120)
{
gaming = System.Random(1,10);
Debug.Log(gaming);
epic_gaming = 0;
}
}
}
Indentations might look weird in the code above so that it fits but I assure you it's fine. Thanks in advance.
this isn't the same as the other question posted below, as that question is just about C# (I even read through it before asking mine) while my problem stemmed from Unity's errors/incompatibility with those methods.