TSubclassOf

Hello, a question about TSubclassOf and NewObject function.

When I use NewObject(Outer, Class) I must specify the Class that usually is a TSubclassOf but how I can do if I want to use the parent class as the Class attribute?

For example if I have a Parent and a Child : Parent (Inheritance). A variable TSubclassOf will “store” any class that is child of Parent (the class Child in my example). But how about if I want to instantiate a class of type Parent (and not a child of it)?

You can do a NewObject<MyParent>();

1 Like

Ah okay simpler than I thought :sweat_smile:. I will try this now

Thank you so much

1 Like