用户:
骑士之刃查看:11 回复:2 评论:11 创建时间:2023-06-21T21:30:49
代码如下:
console.clear();
world.onPlayerJoin(({entity})=>{
entity.enableDamage = true;//开启伤害
entity.player.canFly = true;//开飞行
})
let Mesh = world.querySelector('#喵丛');//在地图中寻找此模型,地图里的模型就叫喵丛没有错的
Mesh.onEntityContact(({other})=>{//碰撞
if(other.isPlayer){//如果碰撞的是玩家
other.hurt(10);//伤害10
}
})
没报错,但是没有伤害,怎么才能做出伤害(其实我想知道怎么开碰撞检测
)
求大佬讲解
谢谢了