I have an actor which will have attached to it a number of sphere collision components. Each one do the exact same thing on overlap - give a reference of itself and the intersecting player to a function, which will be the same function for each of them. The way I want to avoid doing this is in the picture below - that is what I’m looking to automate. I can gather a reference to all of the colliders in an array and iterate through them, but it’s what to do in that iterated step that’s got me stumped. Is there something I can put in a for-each loop iterating through an array of colliders that will mass-specify that each one should call that function providing those arguments?
How to mass-define multiple colliders' overlap event behavior
If you make an array of the components you can mass bind on begin overlap to a single event.
Drag off the array and use Bind BeginOverlapEvent
That did it for me! I’d been fiddling around trying to get something like this to work but hadn’t realized I’d been doing it in a parent function that wasn’t getting called so I’d given up on the method but you got me to re-investigate. I really appreciate it!
To anyone who ever happens upon this, small note to avoid the frustration I did, and that dreaded “delegate is not compatible with delegate (by ref)”: drag the red event pin back from the Bind Event node and choose “add custom event” from that menu NOT “create event”, and specifically from that menu that gets created when you drag the pin and NOT from just right clicking the graph and creating an “add custom event” node.