I want many blueprints of same parent class but with different static meshes inside

I want many blueprints of same parent class but with different static meshes (SM_Cube, SM_Ramp etc) inside so that i can reference them all with a getallactorsofclass() and change all their materials at the same time in a loop. How is this done?

Just experimenting really at this stage.

Thanks.

Hey Drinky! :smile:

First of all, welcome to UE forums. To do what you would like to do, you should first create a parent class:

And then create a child of that parent:

Then inside your Parent class, assign a static mesh:

Be sure that “Editable when Inherited” is ticked (it is by default). Go ahead and select the static mesh to be whatever you want in the parent. Then, create a function/event in the parent class - something like this:
image

Next, in the child, select the static mesh component and switch it to something else:
image

Now, in any other blueprint (I’ll use ThirdPersonCharacterBP), call GetAllActorsOfClass. Then loop thru the array, and call the function we created:

Result looks like this:

Hope this helps! Good luck.

2 Likes

Thanks man, just want i needed. Not sure how to mark as resolved.

1 Like