Announcement

Collapse
No announcement yet.

Is There a way to play a Sound only once and prevent it from overlapping?

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

    Is There a way to play a Sound only once and prevent it from overlapping?

    I have a setup for a Main Menu. It has Options, Levels etc. I have a Music Cue playing when you startup the Menu. In my Options Setting for example is a "Back to Menu" Button. If i click that button, it brings me back to the main menu, but the Music is Overlapping, so i have 2 Menu-Musics playing. Is there a way to prevent that Overlap from happening, i tried DoOnce but it doesn`t work (or i am too dumb).

    I would be happy with any response!

    (Sorry for my bad english)


    #2
    You should keep a reference to the sound component, perhaps in your GameMode. You can then check this IsPlaying first when switching menu's.
    Regardless of the route you choose, you'll need to globally track whether the sound is currently playing, either a boolean or a ref to the component.
    SolidGasGames

    Comment


      #3
      Originally posted by Telimaktar View Post
      You should keep a reference to the sound component, perhaps in your GameMode. You can then check this IsPlaying first when switching menu's.
      Regardless of the route you choose, you'll need to globally track whether the sound is currently playing, either a boolean or a ref to the component.
      Could you perhaps send some Pictures of the IsPlaying Part? And how do i do a Sound Component? (Sorry, just doing UE4 for fun, so I don`t know that much.)

      Comment


        #4
        Check out:
        https://answers.unrealengine.com/que...-finished.html

        With regards to the sound component, you can add it to your level, some guides:
        https://answers.unrealengine.com/que...blueprint.html

        https://forums.unrealengine.com/deve...-in-blueprints
        SolidGasGames

        Comment

        Working...
        X