Need Help With Check Boxes

I am using check boxes for buttons that have an off and on, making a menu ui rn and have buttons for “fullscreen, music, sfx” which all 3 are check boxes. There was no issue but i made a save system and found a bug. Lets say i leave the checked state for fullscreen as unchecked the bp looks like this


when i click the box the “bFullscreen” turns to true and i save it like this, when i load the game i check the booelan via printing and it still is true but ofc the box returns to its old state. So i make a binding for the button to change states and the binding is bFullscreen, but this time when i click it it doesnt change state so nothing happens. How can i fix this bug?

We can’t know what might be wrong without you providing all the related parts of your blueprints, including the entirety of your saving system. Until then, all I can suggest is checking this tutorial out:

i didnt write much about save system cuz i dont think its related to that, but my save system is like this, pretty much same as the video, i store the variables in a struct and bFullscreen is one of the variables that i save



and in the ui at the event on init i load the settings and in the game i save the settings by pressing a key just for debugging.
What i want to achieve is binding the check box to a booelan but still be able to change its state by clicking it. This way when i load the game it will change back to saved state and i have the option to change it by hand.

Wasn’t your issue about not being able to save a variable?

Also, it also matters how you handle the saving. So could you also provide the part where you update your bool type variable’s value that you store in a struct?

i am saving the variable there is no issue there the problem is check box doesnt care what that bool is

I see, in that case, could you show how you bind your widget to that condition?

When i bind it from here
image
it actually works but because its binded already to something i cant press the box and change the state anymore so its stuck. I tried it making in blueprint manually but that become a mess and failed to do it then came to write in forum.

Okay I got on my PC and came up with this:

Widget Blueprint:

Character Blueprint | Begin Play:

Character Blueprint | Saving

Character Blueprint | Loading

Character Blueprint | Triggering Checkbox (optional)

Note: If you’re not triggering the checkbox via keyboard aside from the mouse cursor, you can replace those branch nodes that set the variable named “Check” with Flip Flop nodes.

In the blueprint named “Save_BP”, there’s no code. Just the varible named “Saved Var” is declared there.

And that should be it! :innocent:

1 Like

Everything works fine but i have a small issue at the end

i changed the nodes to flip flop but what will i put instead of “press F” node, check box doesnt have a “pressed” event like buttons do.

Nothing :cowboy_hat_face:

Like I said, it’s optional to trigger the checkbox via keyboard. :blush:

Oh sorry i translated it wrong my bad, not a native speaker. Thanks for your helps

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.