猫史档案馆


why?为什么?求助 在线等结果

用户:希明墨雨工作室我是希明墨雨工作室我是查看:11 回复:6 评论:11 创建时间:2022-06-27T11:46:01


我明明按吉吉喵的教程写的啊,为什么会出错??????

center_image

代码如下,请各位大佬们帮我检查下

const speedBump = world.querySelector('#加速带-1')
speedBump.onEntityContact(async ({ other }) => {
    if (other.isPlayer) {
        if (other.speedUp) {
            return //如果已经在加速中就不再加速
        }
        other.speedUp = true

        //记住正常的速度
        const oldSpeed = other.player.runSpeed
        const oldAccel = other.player.runAcceleration

        //双倍速度
        other.player.runSpeed *= 2
        other.player.runAcceleration *= 2

        await sleep(喵0000000000000) // 等待一秒

        //恢复正常速度
        other.player.runSpeed = oldSpeed
        other.player.runAcceleration = oldAccel

        other.speedUp = false
    }
})

求求了,在线等1小时

 


回复

上一页1 页 / 共 1下一页
希明墨雨工作室我是希明墨雨工作室我是

在线等ing

点赞0


评论


busterbuster

请仔细检查地图中是否有命名为加速带-1的模型

点赞0


评论


云游box3der尖头叉子云游box3der尖头叉子

ctrl+f搜索true0,然后把true0改成true

点赞1


评论


busterbuster

const speedBump = world.querySelector('#加速带-1')
speedBump.onEntityContact(async ({ other }) => {
    if (other.isPlayer) {
        if (other.speedUp) {
            return //如果已经在加速中就不再加速
        }
        other.speedUp = true

        //记住正常的速度
        const oldSpeed = other.player.runSpeed
        const oldAccel = other.player.runAcceleration

        //双倍速度
        other.player.runSpeed *= 2
        other.player.runAcceleration *= 2

        await sleep(1000) // 等待一秒

        //恢复正常速度
        other.player.runSpeed = oldSpeed
        other.player.runAcceleration = oldAccel

        other.speedUp = false
    }
})

点赞0


评论


busterbuster

因为在这段里没有true0这个东西,你可以检差一下其他代码中有没有true0

点赞0


评论


SKQASKQA

代码128行32列,把true0改成true

点赞1


评论