3D模型x方向角度不为0,时。挂刚体和碰撞器。在rotate y方向时。模型会乱转,不挂就没问题
模型x转了-90度
console.log(angle, " lastangel ", this.owner.transform.rotationEuler.y)
this.lastAngle = this.owner.transform.rotationEuler.y;
this.owner.transform.rotate(new Vector3(0, angle - this.lastAngle, 0), false, false)
打印出来看到y方向角度一直在变。
如果直接赋值到rotationEuler就没问题
// this.owner.transform.rotationEuler = new Vector3(-90, angle, 0);
附件:
3dText222222.rar