cant seem to bind an event to "bind event to onclicked" for a button

Im trying to bind the function “add item to equipped” to my inventory buttons when i “add the item to my inventory” since functionality will differ based on what inventory slot the item is in and what item it is. I only know u can bind events to buttons so i simply tried making a custom event calling my functionality and then binding that but im getting errors. I seem to be missing something here, im still rather new.

Any help would be much appreciated

We can’t have Custom Events live inside functions. Try:

image


Do note that you won’t be able to push any data through this generic delegate; this custom event can have no attributes - the signatures must match. You can add a custom event dispatcher by wrapping the button in a user widget if necessary.

hmm it seems my best option is just to make an event in the event graph that handles “add item to equipped” and its inputs. then setting the button affected manually everytime i call “add item to inventory”

Ye the custom event is how i got mine into the function, but i could not pass any input so it was useless for my needs. Not sure i understand ur fix with the user widget

Have the button fire a custom event dispatcher and bind to that. This way you can push any data you want. You may not need to wrap it, kind of depends on how many buttons and what they’re used for. If you’re creating dynamically, and each must do something unique, then it may be necessary.