hubs icon indicating copy to clipboard operation
hubs copied to clipboard

BG - Consider adding sending data over Custom Event

Open j-conrad opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. Often, a Custom Event that's sent in a Behavior Graph is being used to explicitly set some value. But often that value needs to come from somewhere other than the graph with the Custom Event on it. In those cases, it could be helpful to allow the sending of data via the Custom Event itself, like passing an argument along with a function.

For example, you might want to send some kind of ID number of the item that triggered a Custom Event. That way, you could play an animation on that specific object or take away its ability to trigger the event again.

Describe the solution you'd like I'm not 100% sure of the design pattern, but I'd imagine a Custom Event could have a parameter/input for accepting values from other variables or outputs. I haven't considered how to handle missing data or data of an unexpected type.

Describe alternatives you've considered Most of the workarounds have involved lots of branched logic to check for specific values and react accordingly.

j-conrad avatar Nov 14 '23 02:11 j-conrad

It may make sense to add an Entity output to the On Trigger node that outputs the entity that sent the trigger event. That may be the most common use case.

j-conrad avatar Nov 15 '23 06:11 j-conrad