Disabling all input on call temporarily..

I have an interesting situation. My current project is a simulation program that its a virtual representation of the object from real life. Interacting with parts of this object cause changes that take time. Lets say you had to power up a computer. You press the on button, and 15 seconds later the computer has booted and you would like to interact with this computer. I would like to disable all interaction with the computer during the boot phase, primarily the mouse clicks so you cant alter anything. I was thinking i could add some sort of GUI layer that is a large button that is temporarily laid on top of the screen so that is the only thing that is able to be interacted with but has no effect or action to make it seem like your clicks are not being received. Does this make sense? I cant seem to find any code in the scripting manual that does this, so thats my thinking for a work around. What do you guys think?

You could include a boolean for while it’s booting that turns off all input catches.

if (!booleanName) {
  // Input
}

What do you mean by input catches? The animations and other events that take place when interacted with, or actual something related to the mouse functionality?

Basically, if the boolean is true, it ignores all the mouse clicks you want ignored, etc… The technique can be applied to block any sort of input or information.

For example:

function OnMouseDown()
{
   if (!booleanName) { // If the boolean is false
      // Respond to the mouse click
   }
   // Otherwise do nothing
}

is it better to use booleans than say int variables? Iv just been in the habit of using int variables that switch from 0 and 1 to do most of that work. Thanks for your reply :slight_smile:

Well, a boolean can be represented as a 0 or 1 as well, you know. There’s essentially no difference. Heh!

Oh ok, well gotta love being able to do something 4 different ways :smile: