Hi,

So, I have this simple code:

public class SettingsMenu : MonoBehaviour
{
public GameObject modalWindow;

void Start()
{
modalWindow.SetActive(false);
}

public void OpenModal()
{
modalWindow.SetActive(true);
}

I want it to show modal window with my custom options, when you click this button called "OPCJE" (which means "OPTIONS" in Polish):
image
So, basically, the problem is when I have opposite false/true statement. I mean, if I have modal opened and I want it to close - everything works perfect. It doesn't work when I try to OPEN modal window.
In Makinom I have something like this:
image

Is there a possible way to do this sort of thing easier, or try to force my way to work :)?
  • I assume that this disables your Modal tagged game object? The issue is that Unity can't find disabled game objects.

    Change the game object setup in a way that the searched game object stays active in any case, e.g. just disabling a child object on it instead.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Is there a way to do that modal window with Makinom Schematics?
  • Not directly - but you can use the Custom option type to start a schematic on a game object.
    E.g. using an animation machine (which has different functions to call for passing on parameters or no parameters):
    - class name: AnimationMachineComponent
    - function name: AnimationEvent (for no parameter), AnimationEventFloat (for float parameter), etc.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.