获取强制移动物体的速度(位置差 / Delta Seconds)¶
对于被强制移动(直接设置位置)的物体,Get Velocity 拿不到速度,需要每帧用位置差除以帧时间手动计算。
蓝图连法¶
- 用 Get World Location(Target = Static Mesh 组件)取得物体当前位置,SET 进变量 RBCurrent Position。
- 计算速度:
(RBCurrent Position - RBLast Position) ÷ Get World Delta Seconds,结果接 Vector Length 得到速度标量,SET 进变量 RBSpeed。 - 再用 Get World Location 把当前位置 SET 进 RBLast Position,供下一帧做差。
- 接 Delay Until Next Tick,Completed 后回到第 1 步,形成逐帧循环。
注意事项¶
- 关键公式:速度 = 两帧位置差的向量长度 ÷ World Delta Seconds。
- 适用于物体不是靠物理模拟而是被代码/时间轴强制移动的情况。
ID:28 | 更新:2026-06-11
