Generate random number in unity step by step tutorial

Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=cruMQUI1NBU



Category:
Tutorial
Duration: 1:58
205 views
9


ASSALAM o alaikum Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class RandomNumberGenerator : MonoBehaviour
{


// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}


public void GenerateRandomNumber(Text textHere)
{
int randomNumber = Random.Range(0,11); /////// this will generate random number from 0 to 10
textHere.text = "Random number = " + randomNumber;
}
}

/////////////////////////////////////////////////////////////////////////////////////////////
ASSALAM o alaikum
All codes and concepts and videos from this channel are non copyrighted and free to use because we believe that knowledge should be freely available for everyone
/////////////////////////////////////////////////////////////////////////////////////////////

Safar by ASHUTOSH
-----------------------------------------------------------------------------------------------------------------------------------
Track: ASHUTOSH - Time
https://soundcloud.com/grandakt
-------------------------------------------------------------------------------------------------------------------------------------
FREE DOWNLOAD:- https://soundcloud.com/grandakt/safar-produced-by-ashutosh-free-download







Tags:
unity
unity2d
unity3d
learn unity
unity tutorials
unity coding
unity programming
random number generation code
generate random numbers in unity