How to make a if statement for displaying an overlay?

Started by TheeHollow on

Topic category: Help with MCreator software

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a if statement for displaying an overlay?

Help! 

I don't know how to make it so that once I've ticked a checkbox an overlay displays, and when i don't the overlay doesn't display. I know this is probably extremely easy to do, but I really need help!

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try making a global variable…
Tue, 07/16/2024 - 22:57

Try making a global variable to hold a boolean that will hold if the overlay should be displayed or not. Make the checkbox update (with a procedure) this variable to true when it is checked and update it again (to false) when it is not. Make a procedure in the overlay that checks if the global variable is true and then returns true, but otherwise returns false. This will make the overlay appear and disappear depending on the checkbox.

If you need any more help let me know!