用户:
魔以侵心查看:13 回复:10 评论:13 创建时间:2020-04-24T23:17:00
教教我吧谢谢了救我谢谢
如果让玩家碰到一个实体会飞
world.querySelectorAll('.实体标签').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
other.player.canFly = true;
})
})点赞0
评论
如果让玩家开飞机
world.querySelectorAll('.飞机').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return}
other.mesh=entity.mesh;
other.meshScale=entity.meshScale;
other.player.invisible=true;
other.player.canFly = true;
})
})点赞0
评论
岛三有一个模块entity.player,很多单玩家(自己)的代码都依靠它执行 如果要飞起来的话应该就是 entity.player.canFly = true 某澜JS不是懂太多,应该是这样的哈
点赞0
评论
碰到一个实体喵家的皮肤恢复的代码:
world.querySelectorAll('.模型标签').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
other.mesh = ""
other.player.invisible=false;
})
})
mesh代表了玩家的皮肤,mesh = ""就会喵家变回原样
点赞0
评论