-
Creator 版本:3.6.3
-
目标平台: chrome浏览器
-
重现方式:直接运行
public Move(dir: Vec3) {
//设置面向
if(this.camp == CampType.Enemy && dir.y != 0) {
let angle = Math.atan2(dir.y, dir.x) * 180 / Math.PI - 90;
const rotationQuat = new Quat();
Quat.fromEuler(rotationQuat, 0, 0, angle);
this.node.setRotation(rotationQuat);
}
let attriCom = this.AttributeCom;
let pos = this.node.getPosition();
pos.add(dir.multiplyScalar(attriCom.Spd));
this.node.setPosition(pos);
}
我上述代码,编辑器上测试,预制体设置面向旋转是正常的,但是浏览器里就不正常…很奇怪。百分百复现。父物体的旋转角度我打印出来都是-180。但是如果设置预制体下的子物体又是没有问题。就好像浏览器下父物体旋转,影响不了子物体?
有大佬知道咋回事嘛。虽然我已经换个方式解决了。但还是想知道原因。