用户:
迷失冷光查看:2 回复:2 评论:2 创建时间:2021-01-23T12:48:55
此代码只能用于玩家射击
不是武器试验场的轨迹射击
代码:
world.onPlayerJoin(({entity})=>{
entity.player.onPress(({button,raycast: {direction}})=>{
if(button == 'action0'){
const bullet = world.createEntity({
mesh: 'mesh/炮弹模型.vb',//这里填自己的子弹模型
position: entity.position,
collides: false,
gravity: false,
fixed: true,
})
bullet.velocity.copy(direction);
}
})
})
简单吧