I’m working on a point&click puzzle game. This means the game has many Actors that can be interacted with (mouse over, mouse out, left mouse button click). Each Actor has a variable number of components (collision shapes or static mesh). The player interacts with an Actor at the level of the component.
If I have to set this up manually for every actor in the game, it will be a huge job. For instance, a box that needs to be unlocked with a key before it opens and the content inside the box can be picked up. For the keyhole alone, I would need to set up 3 events (mouse over/out, click).
I would like to set up the 2 mouse events for all components in onBeginPlay, since they are the same for all components. However, I can’t figure out how to do it.
I can get an array of sceneComponents for the Actor … but then what ? How do I tell each one of them to respond to eg. onCursorOver ?
Can anybody point me in the right direction ? Thanks !
Thanks @ClockworkOcean ! That is exactly what I’m trying to set up : a generic interactable actor that can be inherited from. The problem I’m having specifically is that events (such as cursor over) are tied to 1 or several components of the actor ; not to the actor itself.
Would you have any idea on how to set that up ?