Sunday, May 14, 2017

Playing a sound in Unreal Engine 4

Just a quick post today explaining how to play a sound. For this instance I will be adding a gun fire sound so that every time the player presses the shoot button you hire a gun fire sound. To start you will need to find your own sound or if you are using the first person template UE4 already has a gun sound. Let's use a sound outside of UE4. Once you have downloaded or have a sound, and make sure that it is a wav file, you can import it into UE4. If you are in the editor there is a import button, simply press that and choose your wav file. Once the file is in UE4 open up the third or first person character blueprint. Once you are in the blueprint editor, right click anywhere on the grid and type in play sound at location. In that there will be a drop down, choose whatever the name of the wav file is. There is also a yellow pin, drag the pin out and type in get actor location. Now you have all you need for the sound to be heard in the game.


No comments:

Post a Comment