猫史档案馆


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

用户:hecoshecos查看:2 回复:8 评论:2 创建时间:2020-04-30T11:08:01


world.querySelectorAll('.test').forEach((e)=>{
    var type='p';
    world.onTick(()=>{
        if(e.meshOrientation.x>=0.5){
            e.meshOrientation.x-=0.1;
            type='m';
        } else if(e.meshOrientation.x<=-0.5){
            e.meshOrientation.x+=0.1;
            type='p';
        } else{
            if(type==='p'){
                e.meshOrientation.x+=0.1;
            } else{
                e.meshOrientation.x-=0.1;
            }
        }
    })
})

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


回复

上一页1 页 / 共 1下一页
YLG_战神_皮卡YLG_战神_皮卡

https://shequ.codemao.cn/community/285951

 

点赞0


评论


TobylaiTobylai

你的名字撞车了,我们早有实体AI实验管,可以四处走动

点赞0


评论


wangjunjiecwangjunjiec

关注你啦!emotion_编程猫_加油

点赞0


评论


Lonely_wandererLonely_wanderer

喵d

点赞0


评论


lon江航lon江航

emotion_编程猫_冷漠emotion_编程猫_点赞

点赞0


评论


AbnormalLOGAbnormalLOG

点赞0


评论


凌_墨水凌_墨水

7个月前……

点赞0


评论


幽梦子曦幽梦子曦

沙发

点赞0


评论