Hey everyone.
I’m making a dice game, not too far away from yahtzee or something where you roll the dice and save some on the side and roll the rest.
Basically right now I want to roll a dice and know what it landed on. It’s like stupidly simple but i don’t really know how I can go about and do it. I might check the rotation? I tried a few rolls and check the transform.rotation to try and check if it’s consistant, but it’s not!
Also it gives me a quaternion, where I really would like to see a vector.
Here’s the masterful coding I did, it gets instanciated with the dice:
function Update () {
if (rigidbody.velocity == Vector3.zero transform.position.y < 3 ){
Debug.Log(transform.rotation);
//apply a tag of what the dice is depending on the face landed up, probably with a simple switch thing.
Destroy(GetComponent(DiceID));
}
}
any tips? Be gentle, i’m a total noob.