You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve?
I am trying to resize a character to be either slightly larger or smaller depending on the race the player has selected in a character customization menu.
- What is the issue?
Although in the customization menu I have managed to accomplish this, in the real game that does not appear to be the case. Although my code is set to offset the C0 and C1 so that it is repositioned correctly, or some reason, the C0 and C1 of the AccessoryWeld of each accessory (taken straight from the Roblox Catalog) does not appear to update even though it is still resized, leaving the accessory to appear correctly sized but slightly off target.
-
What solutions have you tried so far?
This is the code that deals with resizing the accessories so that they are properly sized:
function resize.Accessory(accessory, character, size)
local Vector = Vector3.new(size, size, size)
if accessory:IsA("Accessory") then
local handle = accessory.Handle
handle:FindFirstChildOfClass("SpecialMesh").Scale *= Vector
if handle:FindFirstChildWhichIsA("Weld") then
print("Accessory weld found")
local weld: Weld = handle:FindFirstChildWhichIsA("Weld")
--These two lines do not appear to run
weld.C0 = CFrame.new((weld.C0.Position * Vector)) * (weld.C0 - weld.C0.Position)
weld.C1 = CFrame.new((weld.C1.Position * Vector)) * (weld.C1 - weld.C1.Position)
end
end
end
I’ve tried resizing the character before the accessory and vice versa. I’ve been able to “prove” that for some reason, the two lines that modify the C0 / C1 do not appear to run, as if I were to go into the actual game and then run those two lines manually, it suddenly fixes the problem.
This completely baffles me as this worked perfectly fine in the customization menu, and I am using the exact same code in the real game. The only main issue I can really think of is that since the menu is client-sided and the game is server-sided, the code produces different results. I don’t necessarily understand how this is the case, however. If anyone has any clues as to why this issue is occurring, it would be appreciated if they could try and help.