AccessoryWeld C0 / C1 Does not appear to update whatsoever

You can write your topic however you want, but you need to answer these questions:

  1. 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.

  1. 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.

  1. 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.

1 Like

Did you prove the Co/C1 lines did not run by adding a print after them?

Yes, I moved the print line under the C0 / C1 lines and although it still prints the exact same, it does not appear to update or have any effect.

Ok does the value of the C0/C1 actually change?
Print before and after the asignments

After printing the C0 / C1 values, I noticed that they do change, however it still does not have the desired effect. After running more tests, I can genuinely say I have no clue why this happens anymore, since running it on the server manually works perfectly, as well as on the client (obviously effect isn’t replicated).

What is supposed to happen:

What actually happens:

If you have any reason as to why this is, any help would be appreciated.

in the Vector you have x, y and z as the same.
I think the the object, the hair, is not exactly the same in all directons.
What is the size of the Accessory before resizing?
Are the x, y and z equal?

The size of the accessory before resizing is exactly (1, 1, 1), the default size. They are all equal and I just need it to be slightly resized equally in all directions.

Ok. I am assuming size is > 1 eg 1.1 so vector is 1.1,1.1,1.1
From the screen shot it looks like scale x needs tweaking so try vector(size*0.01,size,size) and see what effect that has.

Hello, I did try your solution, and although it didn’t work (the accessory was incredibly small on the x axis), I was able to eventually find a solution. Thank you for your help.

Would you please share what you did so others may benefit.