Announcement

Collapse
No announcement yet.

[Solved] Stop a sound played through WeaponPlaySound

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Solved] Stop a sound played through WeaponPlaySound

    Is there a way to stop a specific weapon sound played through the WeaponPlaySound function? I have a long sound that can be played during an animation but it is possible this animation will be interrupted and while that works fine, the sound still continues to play when I no longer want it to.

    #2
    Bump in hopes someone has an idea on how to solve this. Even if I have to play the sound through something other than WeaponPlaySound (but still have it follow the player and be replicated or such) I am fine with working with that.

    Comment


      #3
      Look at the UTVehicle code. They have a engine sound that is played (looping) and they turn it on and off when needed. Can't remember exactly which file it's in, but search for Engine and/or Sound and you should find it.

      Comment


        #4
        Thanks! Looking at the code helped me set up a solution for my weapon's sound.

        For anyone with a similar issue here is what you need to do:

        Code:
        var AudioComponent WeaponAudioComponent;
        Code:
        Begin Object Class=AudioComponent Name=ReloadWeaponSound
        		SoundCue=SoundCue'yoursoundhere'
        	End Object
        WeaponAudioComponent=ReloadWeaponSound
        Components.Add(ReloadWeaponSound);
        After that you can then simply call Play() and Stop() on the WeaponAudioComponent. I haven't tested if it is properly replicated yet but it should be easy enough to replicate if it isn't by default.

        Comment


          #5
          how about the soundcue file? did u solve it?

          Comment

          Working...
          X