I want to use a random generated number and save it in a variable. i tried using public float x = Random.Range(minNb, maxNb); but it doesn’t work. Here is the rest of my script.
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
public class Score : MonoBehaviour
{
public float score = 0;
public float scoreMulti = 5;
public float minNb = 100;
public float maxNb = 200;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
score += Time.deltaTime * scoreMulti;
if (score == 70)
{
//save random generated number
}
}
}