Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont my helmet gets welded properly to the Character?

I am trying to make a welding script for a helmet. I am making a customization for my game and I am trying to make a helmet giver. I already made the clothing but I cant add an actually model (helmet) to the Character. I have a doll that had an Transparent helmet, its just to show the player how the helmet looks like. Now, when I am trying to weld the helmet to the player's character, it gets welded. Now I need to set its CFrame:

local weld = Instance.new("Weld", head)

	weld.Part0 = head
	weld.Part1 = helmet
	helmet.CFrame = head.CFrame + Vector3.new(0,1,0) --Here, the helmet gets welded INSIDE the head. I am trying to move it up on the Y axis but I can't.

Any help please?

1 answer

✓ Accepted answer

Hi Danniee,

The reason that the helmet is welded inside of the head and is not moving is because you are trying to change the CFrame of the helmet, not the weld that you attached to the helmet. In order to change the position of Part1 relative to the position of Part0, you need to change the C0 property of the weld.

####Something like this will work, just tamper with the coordinates to get it exactly how you want it:

local weld = Instance.new("Weld", head)

weld.Part0 = head
weld.Part1 = helmet
weld.C0 = weld.C0 * CFrame.new(0, -3, 0) -- I don't know if y is the exact direction you need to change but just experiment with the coordinates to get the helmet just right. 

##Hope I helped and have a wonderful day/night.

Thanks,

Best regards,

KingLoneCat

2 comments

0

Oh wow, I never knew whats the C0 is for. Thank you so much man. Answer Accepted.

0

No problem, glad to have helped.

This discussion is preserved as it was. New answers, comments, and votes are closed.