cocos creator 刚体

//开启刚体
cc.director.getPhysicsManager().enabled = true;

//改变刚体大小,改变其父节点即可
this.node.scale = 0.5;

//获取刚体的速度
this.rigidbody = this.node.getComponent(cc.RigidBody);
var velocity = this.rigidbody.linearVelocity;

//设置刚体的速度
this.rigidbody = this.node.getComponent(cc.RigidBody);
this.rigidbody.linearVelocity = cc.v2(0,0);

你可能感兴趣的:(cocos creator 刚体)