用户:
孤独_背影查看:2 回复:13 评论:2 创建时间:2021-02-22T13:25:27
如图
穿戴三级盔,平底锅,背包。代码如下:
entity.player.forceRespawn(); // 让玩家重生
});
world.onPlayerJoin(({ entity }) => {
entity.player.addWearable({
bodyPart: Box3BodyPart.TORSO,
mesh: 'mesh/探险专用背包.vb',
orientation: new Box3Quaternion(0, 1, 0, 0).rotateY(Math.PI/2),
scale: new Box3Vector3(0.5, 0.5, 0.5),
offset: new Box3Vector3(0, 0, -0.45),
});
});
world.onPlayerJoin(({ entity }) => {
entity.player.addWearable({
bodyPart: Box3BodyPart.TORSO,
mesh: 'mesh/三级盔.vb',
orientation: new Box3Quaternion(0,0,0,0).rotateY(Math.PI/-2),
scale: new Box3Vector3(1,1,1),
offset: new Box3Vector3(0, 0.9, 0.10),
});
});
world.onPlayerJoin(({ entity }) => {
entity.player.addWearable({
bodyPart: Box3BodyPart.TORSO,//装备穿戴的位置在身上
mesh: 'mesh/平底锅-1.vb',//装备是一个叫做“平底锅-1”的模型
orientation: new Box3Quaternion(0, 1, 0, 1).rotateX(Math.PI/135),//
scale: new Box3Vector3(1,1,1),//模型大小长宽高都缩小0.5倍(这段话憋管它)
emissive:number = 0,
metalness:number =1,
shininess: number =1,
color: Box3RGBColor = new Box3RGBColor(7,90,242),
offset: new Box3Vector3(0.5, -0.3, 0.5)//装备的位置,向人背后偏移一些(偏移的X轴是左右手,将X轴的0.5改成-0.5就是左手)
});
});