Components mostly don't support events. Where to place objects that handle them?

Actor Components are described on their doc page as:

useful for abstract behaviors such as movement, inventory or attribute management, and other non-physical concepts

but they don’t support subscribing to most events. I can’t subscribe to input actions, gamepad events, keyboard events, or mouse events. I’m guessing that this is due to how the engine is set up, but if not there, where? Assets I’ve looked at in the marketplace usually end up dumping these directly in the player character, but I don’t want a huge monolithic dumping ground for all gameplay events. If I have some input action that opens the inventory, for instance, I want the inventory component to manage that.

I can work around this by creating a dummy “inventory” actor without any geometry in the character that manages these which is better than dumping them directly on the character actor, but is this an ideal solution? Are there better options?

Create your own message system with dispatcher:

  • create event dispatcher in player controller, player pawn or character.
  • from component hook to that dispatcher
  • send over data

If you want more generic message system create enumerator that tells components what data is sent
And create STRING variable, before sending convert to string then in component convert it back, this way you can send simple data of any type.

Or create multiple dispatchers for every case of data.

1 Like