UE4 attach规则

/** 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位置,重合了。
在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值