Two checkboxes with same function but they seesaw rather than changing together as desired
EDIT: This is only for the sake of the question at this point; I have made a workaround by omitting the duplicate toggles from the pause menu so there is no problem now. There is only one toggle for each sound now; these are located on the Settings Menu. Thanks for the help but I didn't want to waste anyone's time :)
Hi all :)
I have a checkbox to toggle on/off a beep sound (the sound plays when the player makes a mistake).
I have this checkbox on the Settings Menu and on the Pause Menu but, when it is toggled off on one menu, it does change the mute state of the sound correctly but the other checkbox's graphic (check mark) is not updated correctly. The function is right but the visual feedback to the player is wrong.
Is there a way to do this with On Value Changed?
Is there a way to change the image (check mark) by code?
I tried toggle group but this only causes only one of the group to be able to be checked at any given time.
Hope this make sense :)
edit... I suppose could combine the Pause and Options menu somehow as an undesired alternative.
edit 2; more info as requested.
public void MuteKeyPressSound()
{
if (keyPressSound.GetComponent<AudioSource>().mute)
{
keyPressSound.GetComponent<AudioSource>().mute = false;
}
else
{
keyPressSound.GetComponent<AudioSource>().mute = true;
}
}