How to assign a blueprint to many meshes?

Hello there. How can I easily assign this blueprint to a large number of other meshes?

Create child classes so they inherit the code, Or use one class as a dynamic parent replacing the mesh on initialization.

I’m a beginner,could you explain these methods in details?IWhich method is preferable in terms of performance? I think I tried something like second one, using “set static mesh” but after I replaced mesh inn the viewport nothing changed.
Thank you!

Second approach is better all around.

BP_DynamicMesh

  • Scene Component (Root)
  • Static Mesh

Add Variable Dynamic SMC of type Static Mesh Obj Reference

Settings:

  • Instance Editable [true]
  • Expose on Spawn [true]

Construction Script:


The Expose on Spawn and Instance Editable adds a Pin to pass what mesh to assign to the Dynamic SMC variable when Spawning the actor using Spawn Actor From Class.


Only other thing I would definitely add is a Relative Transform variable and set it up just like the Dynamic SMC. This will allow you to position it correctly relative to the Root world location.

Spawn Actor From Class will now “expose” the transform pin.

Thanks!
It works now, but is it possible to transform it like a normal mesh directly in the level, and not only through the Details panel? It’s very inconveniently now.

Once you have it in the level you can do whatever with it.

but when I replace mesh I can’t transform in in the lvel anymore.only in Details

Why not?

I don’t know.Here is my consruction script and event graph:


Run the Set Custom Primitive Data V3 on Begin Play.