猫史档案馆


求助大神!!!!!!!!!

用户:劳姆劳姆查看:38 回复:3 评论:38 创建时间:2020-03-13T20:14:41


大神们,

谁知道开车代码,

在评论区发一下,

150金币


回复

上一页1 页 / 共 1下一页
cool-creepercool-creeper

//选中所有带有标签target的实体,并遍历循环.
world.querySelectorAll('.target').forEach((e)=>{
e.onEntityContact(({entity,other})=>{  //设置目标模型的碰撞事件.
if(!other.isPlayer){return} //防止非玩家实体参与检测.
other.mesh=entity.mesh;  //设置玩家的外观.
other.meshScale=entity.meshScale;  //设置玩家外观缩放比例.
other.player.invisible=true;  //如果模型比玩家小,就需要隐藏玩家的皮肤.
})
})

点赞0


评论


cool-creepercool-creeper

共31条评论,点击查看

点赞0


评论


凌_墨水凌_墨水

控制玩家视角 cameraEntity

• cameraEntityBox3Entity | null = null

在第一人称视角(FPS)或第三人称跟随视角(FOLLOW)下,玩家视角所跟随的实体

cameraMode

• cameraMode"FOLLOW" | "FPS" | "FIXED" = "FOLLOW"

视角模式

示例代码

// 使用第一人称视角
world.onPlayerJoin(({ entity }) => {
    entity.player.cameraMode = 'fps';

    console.log('setting camera mode:', entity.player.cameraMode);
});

console.log('fps mode enabled');

点赞0


评论