Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Xtopher on October 26, 2011, 07:08:56 PM

Title: Audio Play Hangs
Post by: Xtopher on October 26, 2011, 07:08:56 PM
Not sure if this is a playmaker bug, or if it's intended action based on something I don't understand about how audio works in Unity.  Either way, it's totally not what I'd expect or want...

... I'm using "Audio Play" and "Audio Stop" to start and stop the playback of an audio source.  The audio source has "loop"/true, "Play on awake"/false. The Audio Play action will start the loop, but it never finishes if loop/true, and the FSM hangs in that state.  This happens even if I have a "Finished" event specified in the Audio Play action.

I can call an event from another FSM to break out of that state, but doing this and using the Audio Stop action will not stop the audio playback.

I'm seeing this in the latest retail release of Playmaker, and Unity 3.4.1 on OS 10.7.2.
Title: Re: Audio Play Hangs
Post by: Alex Chouls on January 15, 2012, 08:41:09 PM
Sorry, going through old bugs and noticed I never followed up on this one!

You should be able to use Send Event with a delay to exit the state.

The action uses audio.isPlaying to check if the audio is still playing. If not, it sends the Finished Event. So if the audio is looping it will never fire... that seems like the behaviour you'd