猫史档案馆


求求求求求大佬解答代码呜呜呜呜呜!!!!!!!!!!!!!!!!

用户:神界海神唐三神界海神唐三查看:0 回复:2 评论:0 创建时间:2022-07-20T12:41:52


模型电脑交互后电脑询问要监视谁,随后给出在线玩家名称,点哪个,视角就跟随哪个玩家的视角!

悄悄告诉你有超级大奖!


回复

上一页1 页 / 共 1下一页
我爱Kitten我爱Kitten

设置cameraEntity

点赞0


评论


我爱Kitten我爱Kitten

console.clear();
const e = world.querySelector('#电脑-1');
e.enableInteract = true;
e.onInteract(async ({ entity }) => {
    if (entity.isPlayer) {
        let s = [];
        let z = [];
        world.querySelectorAll('player').forEach((x) => {
            s.push(x.player.name);
            z.push(x);
        })
        const npc = await entity.player.dialog({
            type: Box3DialogType.SELECT,
            content: '你要观战谁?',
            options: s,
        })
        if (npc) {
            entity.player.cameraEntity = z[npc.index];
        }
    }
})
world.onPlayerJoin(({entity})=>{
    entity.player.cameraMode=Box3CameraMode.FOLLOW;
})

点赞0


评论