Contents

What are Custom Events?

Custom Events are events that happen only when you tell them to happen. Why would you want to do this?

Reuse Logic. If you're finding that you're copying and pasting the same code, you could stick it into a Custom Event and trigger that Custom Event instead.

Allow other behaviors to cause stuff to happen.

Aside: In programming terms, Custom Events are equivalent to the concept of "messaging" or "indirect invocation" - they aren't quite the same as function calls since you aren't always specifying a receiver. There can be as few as 0 receivers or infinitely many.

Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game,
please ask a question on the forums. Thanks!

2 Comments

MrSnowmanThe major difference you might notice about events and functions is that an event is what activates one or multiple functions. Its a very descriptive name.
It's an event. Something happened, a button click for instance. But you now want to respond to that.03 years, 7 months ago