I’m trying to attach a component to another, and I would like the attached component to always keep its world orientation.
So, if the parent object rotates, I want the attached component to stay exactly where it was, but at the same time I want it to follow its parent if it moves around.
I tried doing it like this:
FAttachmentTransformRules rules(EAttachmentRule::SnapToTarget, EAttachmentRule::KeepWorld, EAttachmentRule::SnapToTarget, false); childComponent->AttachToComponent(parent, rules);
Initially it works, meaning that when I attach the child it keeps its orientation. But as soon as the parent object rotates, the child also rotates, which is what I don’t want. How could I do it?