Passing a class into a function (Blueprint)

I have a blueprint function that runs on the server and spawns AI of the class type that I specify. I have several more specific class types that all live under a parent AI parent class.

I want to be able to pass in the more specific class type (not the parent) into the function so that once inside I can call just one “Spawn AI From Class” and feed that class in. I don’t want to have a mess of a Spawn AI From Class node for each individual class.

Is this possible? And if so, how do I accomplish it.

Thanks!

Ofcorse it is, all types you seen in color pins can be set as variables and arguments in function, including the class. You can do that by searching participle base class of classes you want to pass in variable type selection, and once you find it click it and you have option to either use object or class type or asset version of it.So pick the class (purple one).

Thanks for your quick response.

Are you saying that if my input parameter is set to the parent-class and then I change the type to class type, that I can pass in the child-classes and the class
reference will remain as the child-class?

To use a more visual approach :

Parent Class is 1
Child Classes are 1a, 1b, 1c

If I set the input parameter as class 1, and change type to class reference, can I pass in 1a and have 1a be what is seen inside the function? Or does 1a get cast to 1 when I do that?

If so, this is exactly what I need.

Thanks,

Brian