The Definitions Of Different FAttachmentTransformRules For AttachToComponent Method in UE4

So, in Unreal Engine 4.15.3, the AttachTo method which used to attach a component to another one is deprecated.

We are supposed to use another one called AttachToComponent.

However, there is a parameter in this method which isn’t explained clearly in Epic’s doc or in the engine source code.

From a reply of this topic and my own experience, their definitions are:

-> KeepRelativeTransform: when you are attaching the component you are going to use a relative offset; given by a transform. This is the one that you normally want to use; but depends on the task.

-> KeepWorldTransform: Is going to be attaching the component through a transform translated from world space. I.E. Attach it from exactly where it is in world relatively to the component it is being attached to. So if your actorcomp that your attaching is at the world position FVector(0.f, 0.f, 100.f); It will be attached and keep that world position.

-> SnapToTargetIncludingScale: Snap the actor component to the new parent. This calculates the relative scale of the component that is being attached; so that it keeps the same scale. Essentially this is taking in the scale given and using that. (This one is usually used to attach a weapon to the character mesh.)

-> SnapToTargetNotIncludingScale: This Does the same as the above, but ignores the scale param of the given relative or world transform.

Leave a comment