用户:
斯文的力士甲虫_B6N查看:5 回复:4 评论:5 创建时间:2022-02-09T16:10:25
如题
来自萌新的疑惑
yee089world.onEntityContect(({entity,other)}=>{
if(entity.id=' ')//你要的实体的名称
if(other.isPlayer)
other.canFly=true;
})点赞0
评论
yee089world.onEntityContact(({entity,other})=>{
if(entity.id=' ')//你要的实体的名称 要开可碰撞!!!!
if(other.isPlayer)
other.player.canFly=true;
})
debug完了))应该没事了
点赞0
评论
橙子nUcg我整理了一下楼下的代码,这样:
world.onEntityContact(({entity,other})=>{ //实体碰撞事件
if(other.isPlayer){ //如果其中一个实体是玩家
if(!entity.isPlayer){ //如果另一个实体不是玩家(这样保险一点)
if(entity.id == '实体'){ //实体是要碰撞的实体名字(记住实体要开碰撞)
other.player.canFly = true; //玩家开启飞行
}
}
}
})点赞1
评论
东方绝尘imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%86%B7%E6%BC%A0.gif"alt="emotion_编程猫_冷漠"
点赞0
评论