- Home /
how i can Roll a dice??
hi all
i have to roll dice in a game...
here is script i have written to roll dice...
var prefab: GameObject;
var obj;
function Update () {
if (Input.GetButtonDown("Fire1"))
{
//Destroy (obj);
obj=Instantiate(prefab, Vector3(Random.Range(0,0),50,Random.Range(0,0)), Random.rotation);
Physics.gravity = Vector3(0, -20.0, 0);
}
}
Please any one tell me how i can determine what is on dice?? Please help me... i am stuck in it...
Comment
I wrote a post about it here for non physics http://www.aportagames.com/blog/2014/5/8/dicetodecimals