[开发者心得] 【创作者心得】 让玩家拿起场景中的武器!

[复制链接]
1793 |2
泪染倾城(找闺) 发表于 2023-4-25 11:13:30 | 显示全部楼层 |阅读模式
本帖最后由 泪染倾城(找闺) 于 2023-11-1 13:53 编辑




关键代码
let c = await SpawnManager.asyncSpawn({"guid": "17F10305"});
const character = Player.localPlayer.character;
//设置要插到玩家右手上的位置旋转等
c.relativeLocation = Vector.zero;
c.relativeRotation = Rotation.zero;
//物体插到玩家右手上
character.attachToSlot(c, HumanoidSlotType.RightHand);


关于 GameObjPool 的使用: https://forum.ark.online/forum.p ... ge=1&extra=#pid4715

attach 第二个参数 Gameplay.SlotType 类型介绍

enum HumanoidSlotType {        /** 头发 */
        Hair = 0,
        /** 脸部 */
        Head = 1,
        /** 头部左侧 */
        LeftHead = 2,
        /** 头部右侧 */
        RightHead = 3,
        /** 眼镜 */
        Glasses = 4,
        /** 眼睛 */
        Eyes = 5,
        /** 面部装饰 */
        FaceOrnamental = 6,
        /** 嘴部 */
        Mouse = 7,
        /** 左肩部 */
        LeftShoulder = 8,
        /** 右肩部 */
        RightShoulder = 9,
        /** 左手手套 */
        LeftGlove = 10,
        /** 右手手套 */
        RightGlove = 11,
        /** 背部装饰 */
        BackOrnamental = 12,
        /** 左背 */
        LeftBack = 13,
        /** 右背 */
        RightBack = 14,
        /** 左手 */
        LeftHand = 15,
        /** 右手 */
        RightHand = 16,
        /** 左脚 */
        LeftFoot = 17,
        /** 右脚 */
        RightFoot = 18,
        /** 臀部 */
        Buttocks = 19,
        /** 头顶光圈 */
        Rings = 20,
        /** 头顶标题 */
        Nameplate = 21,
        /** 聊天框 */
        ChatFrame = 22,
        /** 根节点 */
        Root = 23,
        /** 左手肘 */
        LeftLowerArm = 24,
        /** 右手肘 */
        RightLowerArm = 25,
        /** 左大腿根 */
        LeftThigh = 26,
        /** 右大腿根 */
        RightThigh = 27,
        /** 左膝盖 */
        LeftCalf = 28,
        /** 右膝盖 */
        RightCalf = 29,
        /** 第一人称摄像机 */
        FirstpersonCamera = 30
    }







回复

使用道具 举报

汽汽汽汽水 发表于 2023-4-25 16:32:51 | 显示全部楼层
视频雾蒙蒙的
回复

使用道具 举报

泪染倾城(找闺)楼主 发表于 2023-4-25 16:35:49 | 显示全部楼层

调整了fog,你也可以试试看
回复

使用道具 举报

热门版块
快速回复 返回顶部 返回列表