I’m working on a player tower for my tower defense game, but when meshes are scaled down, the accessories placements are wonky. Some are close to the right position, others are way far off. I’ve tried offsets on the SpecialMesh, but they don’t work with every accessory.
local tower = script.Parent
local function applyHumanoidDescription()
local owner = tower:FindFirstChild("Owner")
if owner then
local username = owner.Value
local success, userId = pcall(function()
return game.Players:GetUserIdFromNameAsync(username)
end)
if success and userId then
local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(userId)
local humanoid = tower:FindFirstChildOfClass("Humanoid")
if humanoid then
local successApply, error = pcall(function()
humanoid:ApplyDescription(humanoidDescription)
end)
if successApply then
for _, accessory in ipairs(tower:GetChildren()) do
if accessory:IsA("Accessory") then
local handle = accessory:FindFirstChild("Handle")
if handle then
for _, part in ipairs(handle:GetChildren()) do
if part:IsA("SpecialMesh") then
local scaleFactor = 0.5
part.Scale = part.Scale * scaleFactor
end
end
end
end
end
end
end
end
end
end
applyHumanoidDescription()
1 post - 1 participant