r/gamemaker • • 2d ago

Help! callback does

Post image

In this script, i declare a function so that a time source can call back to it. (the function is only called when the fast_decrease is properly called, so that's not the problem) However, it says that "Time source callback must be a method or function" even though it is.

7 Upvotes

2 comments sorted by

2

u/BrittleLizard pretending to know what she's doing 2d ago

The parentheses at the end mean you're calling decreasinator() as a function, so GameMaker is trying to use whatever it's returning instead of the function itself.

To reference the function itself, just remove the parentheses from decreasinator.

1

u/DragoniteSpam it's *probably* not a bug in Game Maker 2d ago

put the name of the callback without the (); this will assign a reference to the function as the callback, rather than calling the function, and using the result as the callback