Game Music

4 minutes
Share the link to this page
Copied
  Completed
In this video, we'll add an Audio Component inside of BP_GameMode_Gameplay and then write a script in order to play music at the start of our game.

Transcript

Welcome back everyone in this video I want to get some game music going in our background right now is rather boring playing our game because we don't have any acoustical ambience. So wouldn't it be nice if we had a nice musical track backing our gameplay? I think so. So that's the goal in this one. And to make this happen, I'm going to do this all within our BP game mode, gameplay blueprints, so make sure you double click on this guy to open them up. And this is going to be pretty simple to do currently, in our Event Graph for our game mode gameplay, we are just showing the HUD recalling for our HUD to show now again, the game of blueprint is good for the rules of your gameplay, including like what to show on the screen.

In this case, we want to show the HUD we could have done this through a specific HUD blueprint but I chose not to I'm also going to be utilized This game mode blueprints to determine what musical track I want to play during my gameplay. And there are many ways I could actually go about doing this. But I'm going to go this route to make this happen. Over in the components panel of our game mode, we can click this Add Component and I'm going to add an audio component. And I'm just going to call this music underscore game. And with that component selected over in the Details panel, we can slot in what musical track we would like to play now, I actually did import one off camera that I will actually play.

I'm not going to actually give that one to you for free though because it's not free to use. You can use whatever musical track that you may have available available to you. The one I am going to use is one that I like a lot called mind heist, but one that is available within the Seoul City pack is called soul music fly up. I don't think it really fits the feel of this level too much, but it is there to use just to have any musical track. But anyways, I'm gonna be using mind heist, like this track a lot, quite excellent. And then what I'm going to do is I want to actually quiet the sound a little bit.

So under the volume multiplier, I'm going to change that to be point five, I don't want it to be too overwhelming. And that's going to do it for that. Next I need to actually add the script to make this happen. This is going to be simple. I'm just going to drag out a reference to my audio component here. And then I'm just going to drag a wire off of it.

In type in play. Then off of the Event Begin Play I just want to say play the music. Now. You do have the option here of specifying the start time for this but I'd actually want it to be 0.0 let me just check one more setting here with my audio components that auto activate. I actually don't want this to auto activate so I'm just gonna uncheck this because right he actually Yeah, I do want to check that so make sure that that is checked their mind. Let's compile this.

Let's play this or Compile and Save this and then play this and we've got our menu music then level one. thinking, thinking thinking there we go. hear that music in the background. Pretty sweet, I say. So nice track. So again, that's all we need to do to get some music Playing in our background let me just left click, drag out a marquee selection and I will type that C key to start game music let's Compile and Save one more time.

Guys that is gonna do it for this one so feel free to slot in some background music of your choosing. We will see you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.