Announcement

Collapse
No announcement yet.

Explosion sound looping whilst in my main_menu

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

    Explosion sound looping whilst in my main_menu

    Hi guys ..I have just watched a few tutorials on creating a main menu and managed to get the basics done..However my explosion sound is looping in the background whilst i am in the menu ..
    I tried disabling all input whilst in main menu and nothing is stopping the sound..Which only usually plays when the player crashes the ship ..

    #2
    Are you actually saying you need to 'Pause the game' first etc?
    Ship continues to fly and crash whenever a menu is displayed...
    Either way you should show BP where the sound FX is played...

    Comment


      #3
      Hi franktech This is my main menu before the game has even been played . i am not calling the audio at all . I have noticed that my event begin play is firing constantly rather than just once . But even then i never asked the explosion sound to play on event begin play ...So confused right now lol
      The sound only ever gets called by me when the player crashes..But that bp is not even in my main menu level

      Throwing together a quick video will post it asap
      Last edited by Mr_Starfire; 01-02-2018, 11:35 PM.

      Comment


        #4
        https://youtu.be/YjG_Vzpi8rQ I hope i showed everything i needed to
        Last edited by Mr_Starfire; 01-02-2018, 11:49 PM.

        Comment


          #5
          Originally posted by mr_starfire View Post
          Hi franktech This is my main menu before the game has even been played . i am not calling the audio at all . I have noticed that my event begin play is firing constantly rather than just once . But even then i never asked the explosion sound to play on event begin play ...So confused right now lol
          The sound only ever gets called by me when the player crashes..But that bp is not even in my main menu level Throwing together a quick video will post it asap
          mr_starfire

          Sure but make sure to add footage showing ALL your Begin Plays otherwise it wont help much.
          i.e. Is your game actually playing all by itself and crashing in the background while menus are visible...
          This can easily happen if you actually have the default Pawn created by UE4 in your Project Settings...
          If so, either create the Default Pawn in Gamemode after the Menu is closed etc, or Pause the Game.

          See here:
          https://forums.unrealengine.com/unre...r-and-packaged
          https://forums.unrealengine.com/deve...38#post1404638

          Comment


            #6
            It is probably something like that game modes etc confuse the hell outa me so it is likely that thanks again man i gotta go sleep its 4 am here lol

            Comment


              #7
              Originally posted by mr_starfire View Post
              It is probably something like that game modes etc confuse the hell outa me so it is likely that thanks again man i gotta go sleep its 4 am here lol
              4am - What part of the world are you in dude???

              Key question: Where is your Ship created exactly?

              Project Settings -> Maps and Modes (screenshot?)

              Comment


                #8
                Lol i am in the uk .. And pardon my ineptitude but im not sure what you mean by where is my ship created :P

                Click image for larger version  Name:	maps n modes.png Views:	1 Size:	251.9 KB ID:	1407358

                Comment


                  #9
                  Hi franktech i have a collision sphere on my ship.Which was set to overlap all i disabled this and now my problem has vanished...Yay i have to do some testing now to figure out why i had enabled that in the first place ..But for now thanks again

                  Ok so like i figured i had it set to overlap for a reason My ship no longer explodes when crashing into destructible meshes it simply destroys them and continues on its merry way .. So i thought what if i disable generate overlap events whilst in the main menu .But i could not figure out how to check what level i was on . I can get current level name but thats as far as i got .. Now i realy should sleep for at least an hour since its now 9.51 am lol
                  Last edited by Mr_Starfire; 01-03-2018, 05:51 AM.

                  Comment


                    #10
                    Hi franktech i solved this issue with 3 simple nodes .Thanks again bud Click image for larger version

Name:	solved.png
Views:	9
Size:	66.3 KB
ID:	1407703

                    Comment


                      #11
                      Cool, glad you got it sorted dude even if it cost you sleep... ... I think you mentioned before not being so good on the Gamemode / Framework side. I'll mention a few things here in case it helps later. But first what class is actually creating your start menu??? Main_game_mode..... Default Pawn Class -> player_ship..... or Player-Controller etc? Any of these could do it in theory... But its best now to have good structure...

                      In singleplayer you might opt to do core gameplay work in Gamemode. Why? Well, it turns out that Default Pawn Class can spawn before Gamemode. That's why I was asking before if it was set to something or set to none. In a runner game that can cause problems, because the menu can display while the game 'runs' by itself in the background, causing the sound FX of the ship crashing on its own.

                      If this is / was actually happening in your case, you could fix it by pausing the game or adding a Gate to the forward flying logic to block movement looping until the menu is closed. Anyway, if you find that creating a default pawn is causing problems, just set default pawn class to none above in the project settings . Then spawn the ship manually using the Spawn Actor node in Gamemode first (after the menu is closed etc).

                      A question you will ask yourself at some point is, why don't I just keep all my code in Pawn (player_ship), or Player-Controller etc. The reason is Pawns as their name suggests from chess etc are expendable. Pawns come and go in the game, so keeping all your key gameplay logic there is unwise and may even cause hellish problems. Same goes for Player-Controller. Imagine you add local split-screen to the game at some point, then you're going to have to deal with multiple PC's etc. One for each player, then you may be facing two gameplay modules actually fighting each other for control of the game!.... So that's not a good idea either. That's why Gamemode exists, it often acts as the manager / referee (in single-player).

                      Last thing, have a clear division of labor. Keep active UI / Menu code that creates the UI / Menu 'visuals' outside Pawn / Player-Controller / Gamemode. You can show / hide widgets from there, but keep the actual UI code inside widgets etc. Same goes for gameplay logic. That should never be inside UI / Menu widgets. Otherwise your code will get very nasty.

                      All this division of labor means that you need to get confident at BP communication especially Interfaces (for getting UI / Menus to send back info about player choices / selections etc to Pawn / Gamemode / PC). But for now, don't sweat it... I can imagine your response.. Thanks, but that's way too much info especially for someone lacking sleep. No worries, read back over it sometime... Good luck!
                      Last edited by EntrpriseCustomr; 01-04-2018, 08:50 AM.

                      Comment

                      Working...
                      X