Coding Device Interactions in Verse
If you're familiar with Direct Event Binding, the concept of events and functions you're used to working with for Creative devices also translates to Verse. You can use Verse to code your own functions and behavior that run when events occur!
The following sections describe the different ways you can work with Creative device events in Verse and code your own logic.
Binding Functions to Creative Device Events
You can subscribe to events that Creative devices expose in their API. For example, the Button device's class button_device exposes InteractedWithEvent, which occurs whenever the player interacts with the Button device. You can call Subscribe() on the event and pass the identifier of the function that you want to call whenever the event is signaled.
Subscribing allows you to specify a function to call when an event is signaled, referred to as binding to an event. The bound function is referred to as a handler. In the example below, the handler is OnButtonInteractedWith.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.