/** Keeps current relative transform as the relative transform to the new parent. */
KeepRelative,
/** Automatically calculates the relative transform such that the attached component maintains the same world transform. */
KeepWorld,
/** Snaps transform to the attach point */
SnapToTarget,
假设A原来attach到B,后来attach到C:
KeepWorld:保持A世界位置不变,重新计算A相对于parent©的相对位置
KeepRelative:保持A相对于B的位置到A相对于C,重新计算A的世界位置。
SnapToTarget:把A移到C的位置,重新计算A的世界位置和相对于parent©的相对位置
在UE4中检验:
首先在关卡中添加两个测试用的actor: 左边立方体是test1,右边是test2。
在关卡蓝图中设置当游戏开始时test1 attach到test2上:
KeepWorld结果:test1相对位置已经改变,但世界位置没变
KeepRelative结果:test1相对transform没有改变,但世界位置改变
SnapToTarget结果:相对于parent(test2)位置变成了(0,0,0),世界位置移到了test2位置,重合了。