Audio Implementation


author: Riley Darling

Posted on 5/2/2024

Almost always a video game developer uses tools that were made by someone else, an engine of which to make their game for example. Most of the time when using these tools, you have to work with components or code that another human made and understand how it works. Within Unreal Engine their lies a component known as an UAudioComponent and it is ROUGH to work with. 


There is a lot of the Audio Component that seems to work very differently from the other component's I have used in Unreal. First off, there is a specific function called SpawnSound2D that seems to be used instead of the common CreateDefaultSubobject that the other components use. That function also will destroy the component when the sound it is playing ends meaning every time I spawn the sound I have to make a new bind to play the music again when it gets destroyed, and when I stop the music I have to remove the bind on that specific audio element and then stop it or it will just play again.


The main struggle with this audio component has been learning how all the syntax works and hoping that it won't crash. The audio seems to work fine now and I have spent way too much time figuring out how it works, but the good and bad is the more it crashes, the more I learn how to use it and the less it crashes the more I feel like I have an understanding of how it works. In terms of what I can do to make it work better... well I guess just keep doing what I'm doing and wait for it to crash again so I can figure out why it does that. For now at least, it's working as intended.

Leave a comment

Log in with itch.io to leave a comment.