hey guys, i’m trying to reproduce the sound effect of a rolling dice, but i can’t really figure out how to do that. I tryied with a simple oncollision function on a cube mesh, but the result was far from what I need.
Fake like a true conArtist!
var myDiceRolls:AudioClip[]; //assign a few different roll sounds here, in ascending length(shorter to longer clips, for example)
OnCollisionEnter(collision : Collision)
{
if(audio.isPlaying==false)
{
var soundIndex : int = collision.relativeVelocity.magnitude; //this will round the magnitude. Will need tweaking.
audio.clip=myDiceRolls[soundIndex];
audio.Play();
}
}