How do I make my game generate 2 different numbers on the counters? I can get 1 counter to work but on the other one stays at zero even when I attach it to the script itself. Do I have to make a separate code for the other counter?
here’s my code so far
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UiController : MonoBehaviour
{
public Text CountersText;
private int counter;
void Start()
{
counter = 0;
}
// Update is called once per frame
void Update()
{
}
public void OnQuitButtonClick()
{
Application.Quit();
}
public void OnRollButtonClick()
{
int roll = Random.Range(1,14);
counter=roll;
CountersText.text = counter.ToString();
}
}