Set Static Mesh Component

So this seems like a simple question, but I’ve been trying to solve it for two days now without luck.

I have two StaticMeshComponents in my BP, and I’m trying to copy the contents over from one to the other, like so:

282053-smcopy.png

So why does the Mesh (“StaticMesh1”) not show??

  • Components are in the same location
  • Both components are visible and have exactly the same properties

What am I missing here?

(I know I can use the node “Set Static Mesh” to set a Mesh on the Component, but that doesn’t solve my problem. In fact: the real issue that I’m having is that I’m trying to duplicate / copy a ProceduralMesh Component… The Static Mesh Component problem seems to be a simplified version of this problem)

When you set the variable all your doing is storing the pointer (memory address) into another variable. The variable doesn’t contain the component itself, just where it lives in memory. Since you delete the real component straight after, your new variable will just become null. If you want to make a second component you need to use the add component functions and manually set its attributes from the original one to the new one, ie set static mesh, set material etc.

Thanks for your help!

But… There is no way to duplicate StaticMesh without manually adding all the attributes? The key underlying question is coming from my need to copy a ProceduralMesh: there it’s not possible to set all the attributes manually (yes, you can create a mesh section, but you don’t get the collision)

There is a copy node, it looks like a reroute pin, iv never really used it, but worth a try using your setup above, but put a copy pin in between. I presume it works like a memcopy so it could well work

looked in to it, and in fact the Copy node doesn’t work with objects (since the variables are pointers, as your explanation above).

My conclusion is that there is in fact no way to really copy a Component (Object) in BluePrint. You can only Add one, and configure it dynamically.

So I’m closing the question as answered here. Thanks for the help and clarification!