猫史档案馆


【代码岛3.0实体AI研究室】如何让实体来回移动?

用户:hecoshecos查看:0 回复:7 评论:0 创建时间:2020-04-30T11:09:43


world.querySelectorAll('.test').forEach((e)=>{
    var type='r';
    world.onTick(()=>{
        if(e.position.z>=11){
            e.position.z-=0.3;
            type='l';
        } else if(e.position.z<=6){
            e.position.z+=0.3;
            type='r';
        } else{
            if(type==='r'){
                e.position.z+=0.3;
            } else{
                e.position.z-=0.3;
            }
        }
    })
})

实体AI博物馆传送门:https://box3create.codemao.cn/games/15e1ac8436ac2609166e


回复

上一页1 页 / 共 1下一页
两个小八路两个小八路

emotion_编程猫_嗨起来

 

点赞0


评论


lon江航lon江航

emotion_编程猫_点赞

点赞0


评论


AbnormalLOGAbnormalLOG

..

点赞0


评论


东方绝尘东方绝尘

imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%82%B9%E8%B5%9E.gif"alt="emotion_编程猫_点赞"

点赞0


评论


egg鸡蛋蛋egg鸡蛋蛋

如果把模型改成末地烛(?)

点赞1


评论


一只浮梦喵一只浮梦喵

如何碰到实体不穿过?

 

点赞0


评论


东方绝尘东方绝尘

emotion_编程猫_嗨起来

点赞0


评论