[LayaAirIDE 2.0]预制体添加刚体后,和其它刚体碰撞后不能修改角度和位置
onTriggerEnter(other,self,contact)
{
var n=this.owner.rotation;
if(other.label === "heng"){
console.log("角度"+this.owner.rotation);
this.owner.rotation=180-n;
console.log("角度"+this.owner.rotation);
}
if(other.label === "shu"){
console.log("角度"+this.owner.rotation);
this.owner.rotation=-n;
console.log("角度"+this.owner.rotation);
}
}
一用这个方法修改角度就不知道预制体跑到哪里去了
{
var n=this.owner.rotation;
if(other.label === "heng"){
console.log("角度"+this.owner.rotation);
this.owner.rotation=180-n;
console.log("角度"+this.owner.rotation);
}
if(other.label === "shu"){
console.log("角度"+this.owner.rotation);
this.owner.rotation=-n;
console.log("角度"+this.owner.rotation);
}
}
一用这个方法修改角度就不知道预制体跑到哪里去了
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Laya_z
赞同来自: