Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: swc220 on August 19, 2014, 12:54:43 PM
-
I have a character with an automatic rifle and wanted to enable some audio while he is shooting his gun. How could I enable the audio only when he is firing?
-
In the same state you're creating the projectile tell it to create the sound.
-
Right, but when I do that it plays the entire audio clip. Don't I need to set it up in some way so that the audio is disabled when the gun isn't firing. For example, for the muzzle flash, it is in two states. One is in the NotShooting state (in a Set Property) and has enable emission as the property but the check box is unchecked. In the shooting state the check box is checked so that it only goes off while the gun is firing. I want to do something similiar with the sound.
-
It could be easier to have a single shot sound played every time a bullet is shoot, no?
-
That's a good point...
-
I'm actually getting this weird sound now like the audio clip is playing way too fast...
Is there something I could use to tell the audio to wait .1 seconds until it's allowed to play again?
-
Try using the Wait action at the end of the state before you loop back to play again. set it to .1
Edit: Maybe another option would be to set your machine gun audio clip in the inspector and use (get button down, or whatever you're doing to trigger it) Audio Play. Then (get button up) use the action Audio Stop.
-
The wait action did it! thank you!