Answer the question
In order to leave comments, you need to log in
How to make a random number generator in unity?
I wanted to make a random number generator in Unity, but there are errors in the code.
The code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class RandManager : MonoBehaviour
{
public float Result;
[SerializeField] InputField One;
[SerializeField] InputField Two;
[SerializeField] Text ResultText;
public void RandGenerator()
{
Result = Random.Range(One, Two);
ResultText.text = "" + Result;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question