I have a simple script that checks if there is a finger on the screen, then plays a sound, then adds velocity to make a character jump. Everything works fine except when I run it on the iphone, the sound is played multiple times each time the screen is touched.
void update()
{
if (Input.touchCount == 1)
{
AudioSource.PlayClipAtPoint(audioclip);
rigidbody2D.velocity = new vector(0, jumpspeed);
}
}
↧