Download

How to move Static Mesh Components from one to another Actor?

I have an actor blueprint with some components (spawned on runtime) and I want to move these over to another actor blueprint. So I have the static mesh components in an array, give this array to the second actor blueprint, want to copy or move them, and destroy or delete them in the first actor.

Unfortunately I cant find any node for adding already existing components to an actor.

I could just spawn them all again in the second actor, but I think that would be a waste of performance.

So, how can I add existing Static Mesh Components to an actor?

Hello,
If you use add static mesh with mesh selected (or drag mesh from content browesr to event graph) you’ll have your component and will just have to set its transform.

I know, but I want to do it on runtime from blueprint “code”, not in the editor. :wink:
Anyway, thanks for the answer.

If you know the type of mesh, you may can use a custom event / function with the add mesh ready to use and call the custom event / function when needed.

I know, but that would actually spawn every single component again instead of just moving it from one actor to another, and as I said in the first post, I think that’s not really nice regarding performance. Is there no way to just move the component (“reparent” it to another actor)?
For what I need it would work because it is always the same static mesh, but what if I would need to transfer different meshes? There has to be a way to do this… And if not, it’s missing :frowning:

As component is part of the blueprint, i don’t know how you can move it from this blueprint to another one without having issues. For me only actors can be attach detach from one to another. But i may be wrong. Maybe if you detach a component you can attach it then to another blueprint. Have you try detach from parent / attach to with something like cast to ?

It’s not possible to cast from Static Mesh Component to Actor, and only Actors can be attached/detached.

Cast was supposed in blueprint owning component and you can detach a scene component from its parent.
Anyway, if you think that passing component from a blueprint to another is a must have, the best solution for you is to post in answerhub or / and in feedback section, your request to have the full attention you deserve.