- Home /
Take to Unity 5 Beta forum
AudioSource.PlayOneShot only works ONCE on Unity 5?
I am updating my Easy Footsteps script to work with Unity 5. Seems that it is really broken. I ran the updater thing and it presented no errors, but when I start walking around the footstep only plays once. That is it. I have put Debug.Logs over my script to see what is blocking it, the Debug.Logs are reached and there are no errors.
I have also tried to AudioSource.Stop() before calling PlayOneShot but nothing changed. This is really annoying since the raycasts hit properly, everything works properly, I've debugged everything I can - it still only plays once.
This is how the PlayOneShot() part looks like:
if(FootstepHit.collider.tag == FootTag2) {
if(Leg == 1) {
GetComponent.<AudioSource>().Stop();
GetComponent.<AudioSource>().PlayOneShot(Leg2Footsteps[Loop3]);
Debug.Log("Playing sound!");
}
EDIT: Just noticed that when I walk a bit, click away from the editor, and then bring focus back to it - the footstep plays! But again, only once - at the moment when I give focus to the window. This has got to be a bug.
Please take this to the Unity 5 Beta Pre-order forum. We can't really support it here yet due to the huge amount of bugs.
And it's still in Beta.
They need your discussion there.
Answer by John-Citizen · Feb 13, 2015 at 07:48 AM
I've got the same issue... it does appear to be a bug with Unity 5.
Follow this Question
Related Questions
[Unity5] AudioSource PlayOneShot gives "Ran out of virtual channels" 0 Answers
Problem with GetSpectrumData 0 Answers
AudioSource plays noisy audio 1 Answer
Why PlayOneShot is not working? C# 1 Answer