Creating Options
Hello everybody!
This week I decided to create an Options menu so players don't have to have their eardrums blasted out but our awesome sound track. It took me a little while to nail down all of the details that make it work, though.
I knew that I needed the settings to persist when the game is closed and opened and at first I wanted to save the settings based on the user profile that was selected. I realized that this wasn't optimal as the game plays sound before a profile is selected. I then decided to create a separate USaveFile class to save the options.
It was smooth sailing for a while, I managed to get the settings to save and load easy enough. My issue was that although the values saved, the settings weren't applied until the player went back into the options menu and changed them again. This was not acceptable.
I had done a little research into my UGameInstance class and first came across the Init() function. I thought that it was the perfect place to load my audio settings when the game loaded, but I was wrong. With my LoadAudio() function inside of the Init() function, the values were updating but were not applying! After a little more research I learned that the function I should be using was actually OnStart().
That was my adventure with figuring out volume control! Thanks for tuning in and I hope you come back for next week's post!
Corbin Mein
Comments
Post a Comment