How do you dynamically cast by providing reference and class?

I am trying to setup a blueprint that gets the actor class type from another blueprint, then takes an action on selected actors of that type. I am having trouble finding a way to cast the result into a usable form, since I don’t know the actor class until run time.

Basically I am looking for a cast type node / method that has inputs for actor class, and actor reference, and has an output of actor reference. (So it converts the inputted actor reference to the inputted actor class type)

Is there something that already does this? Or do I need to build my own solution.

Thanks!

I’m currently working around this, by adding a component that will be the same on each actor, that contains the data I need. So I can dynamically cast to the parent, then force cast to child instead. If anyone knows an answer to the question though, I am curious as to a solution.