猫史档案馆


碰到模型就能够飞起来的代码求助!

用户:帅气的剑杰帅气的剑杰查看:25 回复:7 评论:25 创建时间:2020-08-20T15:31:40


如题,碰到模型就能够飞起来的代码求助!!!!


回复

上一页1 页 / 共 1下一页
帅气的剑杰帅气的剑杰

额,还有用什么代码可以和模型互动?

点赞0


评论


帅气的剑杰帅气的剑杰

DD

点赞0


评论


SKQASKQA

在吗

我会

点赞0


评论


某狻猊某狻猊

DDD

点赞0


评论


SKQASKQA

world.querySelectorAll('.XX').forEach((e)=>{ //选中所有标签为XX的模型
    e.onEntityContact(({entity,other})=>{ //设置碰撞事件
    if(!other.isPlayer){return} //防止非玩家实体参与检测
    other.canFly=true; //玩家飞行
    });
});

点赞0


评论


帅气的剑杰帅气的剑杰

world.querySelectorAll('.啊哈哈').forEach((e)=>{ //选中所有标签为XX的模型
    e.onEntityContact(({entity,other})=>{ //设置碰撞事件
    if(!other.isPlayer){return} //防止非玩家实体参与检测
    world.say('恭喜找到彩蛋!')
    other.canFly=true; //玩家飞行
    });
});

点赞0


评论


帅气的剑杰帅气的剑杰

world.querySelectorAll('.狗头').forEach((e)=>{ //选中所有标签为XX的模型
    e.onEntityContact(({entity,other})=>{ //设置碰撞事件
    if(!other.isPlayer){return} //防止非玩家实体参与检测
    world.say(entity.player.name+'复原成功!')
    });
});

点赞0


评论