say I wanna print("I eat kids") for when the value of my var (let's call it 'variable') equals to 0. so I write: "match variable: 0: print("i eat kids")"
But what if I only want it to happen once? can I do that somehow?

Sure. Run the match statement only once. You probably have it inside _process() so it's automatically executed each frame. Simply put in in some other function and call it on demand.

  • miau replied to this.

    xyz uh well I don't think it works? like I write 'print("the greatest")' and it just endlessly writes that

    • xyz replied to this.

      If I get what you're asking, try using a signal or input event to run the match statement. I'm imagining you have it sitting in _process.

      • miau replied to this.

        miau I edited my above post. Get it out of _process() callback. Or introduce a control flag variable that switches its own state once the message is printed.

        packrat oh my goodness, I like totally forgot it actually was in process. Thanks dude