Calling a function based on component hit

I’ve got an actor, say a “ship” with child components. Say it has two components, something like two cubes called “IncreaseVelocity” and “DecreaseVelocity”.

I’ve got a trace set up on the first person character controller which returns the hit component.

How would I call a function in the “ship”, based on the component that the trace hit?

For something with just a couple of components, this might just be enough:

For more components, make array from the Ship’s components and loop.

I guess this is the only way after all?
Fair enough, will make it work with a loop, thanks for your answer!