You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让Dummy同步单玩家游戏内Player的外观?

解决Dummy复刻Player外观仅头部同步的问题

你的代码存在几个关键问题,导致只有头部能同步:

  • GetAppliedDescription是Humanoid的方法,你没加括号调用,传递给ApplyDescription的只是方法本身,不是实际的外观描述对象
  • 单玩家游戏没必要遍历所有玩家,直接取本地玩家即可,避免多余操作
  • 未做角色加载判断,可能在玩家角色还没生成时就执行代码,导致获取不到有效对象

修正后的代码:

-- 等待本地玩家及角色加载完成
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
local playerHum = character:WaitForChild("Humanoid")

-- 确保Dummy的Humanoid已加载
local hum = script.Parent:WaitForChild("Humanoid")

-- 获取玩家外观描述并应用给Dummy
local appearanceDesc = playerHum:GetAppliedDescription()
hum:ApplyDescription(appearanceDesc)

额外注意:

  • 要保证Dummy和玩家的人形模型类型一致(同为R6或R15),否则外观同步会出现异常
  • 如果玩家后续更换外观,可监听Humanoid.DescriptionChanged事件,重新执行同步逻辑

内容的提问来源于stack exchange,提问作者RonnebladA

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 12:54:28