用户:
Lingooy_月查看:5 回复:8 评论:5 创建时间:2021-06-21T20:01:26
首先,你得放个要发射的模型() 再放个用于装饰,拿在手上的模型() console.clear() const Quat = new Box3Quaternion(0,0,0,1) world.onRelease(async ({entity, button, raycast:{direction}}) => { //每当有按钮被按下 if (button == Box3ButtonType.ACTION0) { const 喵 = world.createEntity({ mesh:'发射的模型', position:entity.position, meshScale:new Box3Vector3(0.1, 0.1, 0.1), collides:false }) 喵.gravity = false const 喵_orientation = Quat.rotateY(Math.atan2(direction.z, direction.x)).rotateY(-Math.PI / 2).rotateY(-Math.PI / 2) 喵.meshOrientation.copy(喵_orientation) for(i = 0; i <= 4; i++){ 喵.position.x += direction.x 喵.position.z += direction.z await sleep(200) } await sleep(1000) 喵.destroy() } }) world.onPlayerJoin(({ entity }) => { entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: '拿的东西', orientation: new Box3Quaternion(0, 180, 60, -160).rotateY(Math.PI / 2.5), scale: new Box3Vector3(1, 1, 1), offset: new Box3Vector3(0, 0.2, 0.6), }) 就完事了 doge~
Lingooy_月console.clear() const Quat = new Box3Quaternion(0,0,0,1) world.onRelease(async ({entity, button, raycast:{direction}}) => { //每当有按钮被按下 if (button == Box3ButtonType.ACTION0) { const 喵 = world.createEntity({ mesh:'发射模型', position:entity.position, meshScale:new Box3Vector3(0.1, 0.1, 0.1), collides:false }) 喵.gravity = false const 喵_orientation = Quat.rotateY(Math.atan2(direction.z, direction.x)).rotateY(-Math.PI / 2).rotateY(-Math.PI / 2) 喵.meshOrientation.copy(喵_orientation) for(i = 0; i <= 4; i++){ 喵.position.x += direction.x 喵.position.z += direction.z await sleep(200) } await sleep(1000) 喵.destroy() } }) world.onPlayerJoin(({ entity }) => { entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: '装饰', orientation: new Box3Quaternion(0, 180, 60, -160).rotateY(Math.PI / 2.5), scale: new Box3Vector3(1, 1, 1), offset: new Box3Vector3(0, 0.2, 0.6), })
点赞0
评论
Lingooy_月const Quat = new Box3Quaternion(0,0,0,1) world.onRelease(async ({entity, button, raycast:{direction}}) => { //每当有按钮被按下 if (button == Box3ButtonType.ACTION0) { const 喵 = world.createEntity({ mesh:'mesh/斩(红黑).vb', position:entity.position, meshScale:new Box3Vector3(0.1, 0.1, 0.1), collides:false }) 喵.gravity = false const 喵_orientation = Quat.rotateY(Math.atan2(direction.z, direction.x)).rotateY(-Math.PI / 2).rotateY(-Math.PI / 2) 喵.meshOrientation.copy(喵_orientation) for(i = 0; i <= 4; i++){ 喵.position.x += direction.x 喵.position.z += direction.z await sleep(200) } await sleep(1000) 喵.destroy() } })
点赞0
评论
薹灣解放再改名首先,你得放个要发射的模型() 再放个用于装饰,拿在手上的模型() console.clear() const Quat = new Box3Quaternion(0,0,0,1) world.onRelease(async ({entity, button, raycast:{direction}}) => { //每当有按钮被按下 if (button == Box3ButtonType.ACTION0) { const 喵 = world.createEntity({ mesh:'发射的模型', position:entity.position, meshScale:new Box3Vector3(0.1, 0.1, 0.1), collides:false }) 喵.gravity = false const 喵_orientation = Quat.rotateY(Math.atan2(direction.z, direction.x)).rotateY(-Math.PI / 2).rotateY(-Math.PI / 2) 喵.meshOrientation.copy(喵_orientation) for(i = 0; i <= 4; i++){ 喵.position.x += direction.x 喵.position.z += direction.z await sleep(200) } await sleep(1000) 喵.destroy() } }) world.onPlayerJoin(({ entity }) => { entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: '拿的东西', orientation: new Box3Quaternion(0, 180, 60, -160).rotateY(Math.PI / 2.5), scale: new Box3Vector3(1, 1, 1), offset: new Box3Vector3(0, 0.2, 0.6), }) doge~点赞0
评论
坦率的血翼蝠5801console.clear()
const Quat = new Box3Quaternion(0,0,0,1)
world.onRelease(async ({entity, button, raycast:{direction}}) => {
//每当有按钮被按下
if (button == Box3ButtonType.ACTION0) {
const 喵 = world.createEntity({
mesh:'发射模型',
position:entity.position,
meshScale:new Box3Vector3(0.1, 0.1, 0.1),
collides:false
})
喵.gravity = false
const 喵_orientation = Quat.rotateY(Math.atan2(direction.z, direction.x)).rotateY(-Math.PI / 2).rotateY(-Math.PI / 2)
喵.meshOrientation.copy(喵_orientation)
for(i = 0; i <= 4; i++){
喵.position.x += direction.x
喵.position.z += direction.z
await sleep(200)
}
await sleep(1000)
喵.destroy()
}
})
world.onPlayerJoin(({ entity }) => {
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: '装饰',
orientation: new Box3Quaternion(0, 180, 60, -160).rotateY(Math.PI / 2.5),
scale: new Box3Vector3(1, 1, 1), offset: new Box3Vector3(0, 0.2, 0.6),
})
})点赞0
评论