playMaker

Author Topic: Machine gun sounds when firing.  (Read 3130 times)

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Machine gun sounds when firing.
« 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?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Machine gun sounds when firing.
« Reply #1 on: August 19, 2014, 04:00:48 PM »
In the same state you're creating the projectile tell it to create the sound.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Machine gun sounds when firing.
« Reply #2 on: August 19, 2014, 05:08:09 PM »
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.

Sly

  • Full Member
  • ***
  • Posts: 123
Re: Machine gun sounds when firing.
« Reply #3 on: August 19, 2014, 05:11:02 PM »
It could be easier to have a single shot sound played every time a bullet is shoot, no?

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Machine gun sounds when firing.
« Reply #4 on: August 19, 2014, 05:11:43 PM »
That's a good point...

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Machine gun sounds when firing.
« Reply #5 on: August 19, 2014, 05:24:05 PM »
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?
« Last Edit: August 19, 2014, 05:32:40 PM by swc220 »

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Re: Machine gun sounds when firing.
« Reply #6 on: August 19, 2014, 05:38:15 PM »
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.
« Last Edit: August 19, 2014, 05:46:13 PM by Sarcophagav »

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Machine gun sounds when firing.
« Reply #7 on: August 19, 2014, 05:54:38 PM »
The wait action did it! thank you!

« Last Edit: August 19, 2014, 06:01:17 PM by swc220 »