Adding and attaching a skeletal mesh component at runtime

Hi fellow UE4 users, I’m wondering if I’m missing something here. Cutting a long story short, I have a skeletal mesh of a hat with a tassel. I want the tassel to react to physics and I also want to be able to attach this at runtime (with Simulate Physics set to true on the Add node). So I make the following graph, and if I call it from the Constructor Script graph, it works fine.

BUT if I instead remove the call from the constructor, and just call it at any point during runtime, the resulting physics is extremely unstable and the tassel jumps all over the place for no good reason. Again: it’s totally fine if I just call it during the construction script.

I’m hoping I’ve missed some kind of “re-register component node” that I should be calling at the end, but so far I’ve found nothing.

Thanks,
Matt

So playing around I found a way to make it work -

  1. Leave the skeletal mesh asset-reference blank on the “Add Skeletal Mesh Component” node
  2. Attach it to the component with the socket.
  3. Now set the skeletal mesh.
  4. And have it simulate physics.

I guess it’s a quirk of this version of the engine, not sure if it is still a problem in version 4.21 and above.

2 Likes

Thank you so much! very helpful to me.