I have one interesting idea, but I don’t know does this thing exist in engine. So imagine static mesh component (SMC). This component has function “OnComponentStartOverlap”, so each time when SMC overlap something this function firing in owner of this SMC. But can I make some custom function which will work in the same way? Function like this.
For example, I have cube component (CC), and every time someone look on it, it fire in the owner function “OnCubeLook”. I could make this thing using interfaces, for example every time someone look on cube, this cube make interface call to it’s owner. But what if my actor has more than one CC. Every CC will call same interface function, and I would not have a chance to find out from which component was made this call. I can give to component some editable integer variable, and pass it through interface call, but it already too complex. So, my question: Is there any other way to make this, through blueprints or code? I hope I explained this understandably, and I wait your good thoughts on this point
Indeed, you can achieve this creating Custom Events (Or any functions) for BP components. Quick and dirty example:
- Create a new blueprint component. Inside it, add a custom event.
- Create a new blueprint actor. Inside it, add the component you just created. Then get a reference to your component. You will be able to drag the event you created for that specific component – so you could have 5 of the same components and access the same event for each one of them separately.
Thanks you very much! That exectly what I searched:)
Wait I just realise, it is not what I want. It is call function, so I fire event in component, and I need to fire event in actor by component. So when something happened in component, it fire some event in actor. Like “OnComponentOverlap”. Every time when component overlap something, it fire event in actor, and if I have more then one component, I can have “OnComponentOverlap” event for each of them. But instead of “OnComponentOverlap” event, I need some custom event or function…
P.S. Sorry for first answer, I doblecheck just now.