Casting Help

HI ,

Where are you setting the “Game Menus” variable? While it may be a varialbe of type “Game Menus”, it will remain NULL unless populated. This may be causing the cast failed error you are seeing.

I am using a variable to store my volume setting in my widget blueprint and I am trying to access it from my spaceship to adjust the fmod audio volume through a variable in the fmod sound effect file. When I play the game the sound is at 0 even when the variable in the widget blueprint is set to 1. I adding a command to the cast fail to change the resolution to 5x5 and when it booted up it was 5x5. This tells me the cast failed and I want some pointers as too

it does not let me add my game_menus widget blueprint to the default value

When you create GameMenu widget, make sure to get the object reference that was created and set it to Game_Menus.

Its hard to see how you have it set up without seeing more of the blueprint (like said, where did you set the Game_menus variable)

where would i set the game_menus variable

You want to populate it when you create the widget like this -

73350-populatewidget.png

Thanks for the help. I moved my pause menu into the spaceship script so i can do this. I ticked the config variable box but the volume changes back to the default value every time that i play. Will this be fixed when the game is packaged of do i need to do something more for that to happen

What all is interacting with that value? Do you have it being set on construct? If so, depending on how you are creating the widget/when and how you are removing it it may be setting the variable each time the widget is being constructed.