moving the scale to 1 works if i wait for the animation to finish before releasing the button, otherwise it still stores the last value used.
i tried another approach, i added a canvasgroup component to the empty objects. Then used the 3 values to hide the buttons instead of disable the group. There is still a bug in unity and using a delay between setting blockraycast=false and the other 2 parameter seem to work…
https://forum.unity.com/threads/clicking-a-button-leaves-it-in-mouseover-state.285167/
public void OptionsButton ()
{
EventSystem.current.SetSelectedGameObject(null);
StartCoroutine(DelayedDisableCanvasGroup(startMenu));
EnableCanvasGroup(optionsMenu);
}
void EnableCanvasGroup(CanvasGroup cg)
{
cg.blocksRaycasts = true;
cg.interactable = true;
cg.alpha = 1;
}
IEnumerator DelayedDisableCanvasGroup(CanvasGroup cg)
{
cg.blocksRaycasts = false;
yield return new WaitForSeconds(0.01f);
cg.interactable = false;
cg.alpha = 0;
}