用户:billy司马白鹿查看:4 回复:9 评论:4 创建时间:2020-03-09T21:42:45
自己钻研了一下模仿的
//选中所有带有标签target的实体,并遍历循环.
world.querySelectorAll('.target').forEach((e)=>{
e.onEntityContact(({entity,other})=>{ //设置目标模型的碰撞事件.
if(!other.isPlayer){return} //防止非玩家实体参与检测.
other.mesh=entity.mesh; //设置玩家的外观.
other.meshScale=entity.meshScale; //设置玩家外观缩放比例.
other.player.invisible=true; //如果模型比玩家小,就需要隐藏玩家的皮肤.
})
})