Download

Should I be driving my useable items with an event, or with a delegate?

The most extensible system I’ve thought of to make items interactable (people you can talk to, items you can pick up) is to make a core UInteractable component, add it to every object I want the player to be capable of using, and make the use key call some event/delegate ObjectUsed(AActor* callback). ObjectUsed has absolutely no functionality inside UInteractable, the purpose is to let objects which have the component subscribe to the event- people open their conversation window, items add themselves to the player’s inventory, lights turn themselves on or off, and so forth.

Where I’m confused is the difference between an event and a delegate in ue’s implementation: is one an obviously better choice for my use-case than the other?