Problem with AttachActorToComponent and Skeletal Mesh

I have a weird behavior with attaching an Actor.

The setup is like in the picture. A rifle should be attached to a hand.

If i use the Node AttachActorToComponent the Actor gets indeed attached, but one of its components, the Assault_Rifle_B (a skeletal mesh component) is not moving.

If i instead use the node AttachComponentToComponent the rifle gets attached correcly and moves. But like the name of the node states it is just the Component that gets attached, not the whole actor.

Is there a reason why one is working as intended, and the other is not?

Does AttachActorToComponent maybe doesnt work with Skeletal-Meshes?
I’m using the same setup with a static mesh, and it works just fine.

I figured out the problem. For some reason the problem was the DefaultSceneRoot.
I’m not sure why exactly this lead to this weird behavior, but deleting the defaultSceneRoot solved the problem.

Better Solution:

It seems i was wrong. The Problem was not really DefaultSceneRoot.

The Problem seems to be, that when you set “Simulate Physics” to false in the Blueprint, die SkeletalMeshComponent becomes somehow detached from its Parent.

So whats happening when AttachActorToComponent is used, is, that the RootComponent gets attached to the target, but the now unparented SkeletalMeshComponent does not.
The Solution is, to reattach the SkelettalMeshComponent to the root object, after the “Simulate Physics” was disabled, like it is shown in the Pic below.

This way everything works fine to me now.

1 Like