Thursday, April 26, 2012

Sound Programming Reminders


function OnMouseDown()
{
audio.Play();
}

This function allows me to make sounds whenever I click on the object this script has been partnered with.

function OnCollisionEnter()
{
audio.Play();
}

This script plays a sound if a cube with a rigid body is picked up and thrown, this gives whatever shape a sound effect when it hits the ground.

No comments:

Post a Comment