- Home /
Question by
greatUnityGamer · Aug 31, 2013 at 02:25 AM ·
soundwalkingsound-overlapping
How do i play a sound as long as Character Walking but don't Repeately restart the sound?
INstead let it finish and then if still walking, then repeat it.
I have a decetly long walking sound so.
if i do something like this
if( City CHaracter is walking) if( sound is not already playing ) then play sound
Would that work? How do i check if sound is already playing?
Comment
Best Answer
Answer by aldonaletto · Aug 31, 2013 at 03:52 PM
You could use audio.isPlaying :
if (!audio.isPlaying) audio.Play();
But notice that audio.isPlaying only works when you play the sound with audio.Play() - audio.PlayOneShot(audioClip) doesn't set this property.
Your answer
Follow this Question
Related Questions
How to make walking sound effects? 0 Answers
Sound Problem 1 Answer
Changing sound when walking in different areas. 1 Answer
Switch between two different sounds for walking and sprinting? 1 Answer