I have 2 canvases in my heirarchy. Both of them have a remember visibility component on them. One of them is set to on and the other off. I have a button that's supposed to turn one of the canvases off and the other on when clicked but the issue is that both canvases show when the game starts. I don't know if that's how unity does it but is there a way to not have both canvases showing when the game starts? without using menus?
Comments
The Remember Visibility component won't record the state of Canvases, and disabling one will prevent it from being accessable by the save system.
To control a Canvas's visibility so that the save system can record it, attach a Canvas Group component and set its Alpha value to 0/1 to hide/show it. The Interactable option can be used to make it interative / non-interactive.
Using AC's provided save components, saving would be a case of animating the above values, and then making use of the Remember Animator component. That is, you'd attach an Animator that has an "On" state and an "Off" state, each of which affect the Canvas Group's Alpha and Interactable values accordingly. The Object: Animate Action would then be used to control which animation is played, which the Remember Animator component will record.
Alternatively, you can make use of a custom Remember component that directly saves the state of the Canvas Group. A tutorial on this topic can be found here, but something along these lines ought to do it:
You'd need to similarly use scripting. I've added a pair of TurnOn / TurnOff functions to the above script - you can use either the Object: Call event or Object: Send message Action to run them in ActionLists.