请问Creator 3D 刚体通过冲量的问题

目前移动通过rigidBody.applyImpulse施加x和y
完成后会呈现绿色这条最终位置
刚体要怎么逐渐往黄色这条线最终位置移动
相当于方块中心点位置

主要是需要把力或者冲量计算出来,以下代码可以实现朝任意目标点的运动

// 计算方向,target是一个目标节点,可以换成你自己的
const dir = new Vec3();
Vec3.subtract(dir, target.worldPosition, this.node.worldPosition);
dir.y = 0;
dir.normalize();

// 添加大小
const force = new Vec3();
force.set(dir);
const length = 300;
force.y = 1; // 设置为1,让物体在Y轴的受力朝上,也可以根据需要改成别的
force.multiplyScalar(length);

// 施加力
this.getComponent(RigidBodyComponent).applyForce(force);

// 或者施加冲量
// 但长度和力的不一样,比例大概是 1/deltaTime
// 比如 dt = 0.0166 ,力长度是 300 时,冲量大小等于 300 * 1/0.0166 = 4.9
// this.getComponent(RigidBodyComponent).applyImpulse(force);

主要是想固定跳跃高度
想请问为什么这样都会偏移x或z

const dir = new Vec3();
Vec3.subtract(dir, target.worldPosition, this.node.worldPosition);
dir.y = 0;
dir.normalize();

const force = new Vec3();
force.set(dir);
const length = 4.9;
force.multiplyScalar(length);
force.y = 7.5;

this.getComponent(RigidBodyComponent).applyImpulse(force);

@JayceLai
移动一次位置错的
移动两次位置却正确了