怎么刚体随着手指滑动的x,y设置冲量?
this.node.on(‘touchmove’, event => {
const { x, y } = event.touch.getDelta();
let rigidbody = this.node.getComponent(cc.RigidBody)
let pos = this.node.parent.convertToWorldSpaceAR(cc.v2(this.node.x+x,this.node.y+y))//转化为世界坐标
rigidbody.applyLinearImpulse(pos, rigidbody.getWorldCenter(),true);
});
我这么写是错的,监听滑动后,刚体就一直移动停不下来
移动完了不把线性速度重置为0怎么可能会停下来
线性速度重置为0还是停不下来怎么办?