Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Why does my sound play multiple times using touchcount?

$
0
0
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); } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>