✅ Solved: Check Box with view model always checked when loading [FIXED]
I created a check box view model that is a child of my Game’s menu view model. It has a boolean property called Checked that determines the state of the check box.
In my JavaScript when the menu first loads, I set the checked state to the value of the setting. The problem is that it is always checked when I load. I can tell it is restoring the setting correctly though because when it is false in the setting, clicking on the checkbox stays in the checked state. When it is true, the check goes away so it seems like the visuals are the problem.
Here’s my code:
// My code for getting the view model property
this.viewModel = this.file.defaultArtboardViewModel(this.artboard).defaultInstance();
this.disableTutorials = this.viewModel.viewModel('DisableTutorialsCheckBox');
this.tutorialDisabled = this.disableTutorials.boolean('Checked');
// then when I initialize the variable I call this
this.tutorialDisabled.value = localStorage.disableTutorial == "true";Here’s the file backup:
menu.revAnd here’s the game demo:
QuerentThank you for the help!