代码如下,想让这个节点以每帧10像素向右移动
export class rigid2d extends Component {
start() {
PhysicsSystem2D.instance.enable = true;
let rigid_comp = this.node.getComponent(RigidBody2D);
rigid_comp.linearVelocity = v2(10, 0);
}
duration: number = 0;
protected update(dt: number): void {
console.log(this.node.getWorldPosition().x);
}
}
打印结果如下:
480
485.3333435058594
490.66668701171875
496.0000305175781
501.3333740234375
506.6667175292969
…
实际每一帧位移约等于5.3333
,为什么出现实际移动不是10,明明一定是10的

