wrap actors of the same type of class in a common actor class

hi

is it possible, or what is the best way, to wrap unique / different actors of the same type or class in a common actor class

say you have x actors that differ but share common properties
being able to access them as the same actor class has the benefit of easily getting to the shared properties without first having to cast to individual classes because they have a similar class they share that contain the necessary information that would eliminate first casting to individual classes

so i guess to implement this one can have a top level actor blueprint that contain the common properties as variables, and then have the top level blueprint spawn the corresponding (sub) actor based on its unique type

is there a better way to do this

thanks

i mean that’s what inheritance is, but it may be better to use ActorComponents.

i say this because some class inheritance cant be changed, ie Character

1 Like

ok can you perhaps quickly note how you inherent or create the inheritance

create your actor class, lets say MyActor
then create child actor classes (right click on it in editor and CreateChildClass) from that MyActorA, MyActorB

when you spawn a child class (MyActorA) save its return value as the parent (MyActor) to only have the common methods.

1 Like

thanks