Playing sound effects

When it comes to playing any type of sound, Unreal gives you more than one method and you have to pick the one that fits you and the situation of that sound. The most common and popular methods I've found are:

  • Through C++ code: You can play the sound of any AudioComponent, by simply using the member function Play() and, yes, just one line to run a sound.
    AudioComp.Play(float StartTimer);
  • Through blueprint nodes: Within a blueprint you can simply play sound using any of the Play Sound nodes. You can play a 2D sound, which means it will have the same volume always, or play it at a location in order to fade the sound in and out while getting closer or further away from it.
  • Through animation notifications: Just as we used to set ...

Get Mastering Unreal Engine 4.X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.