How to use motor6D in script?

im trying to make a viewmodel and weld the gun to the viewmodel when you enter firstperson and when you go in third person the gun welds to your arm

third person works fine but when am trying to weld to the viewmodel im getting the same results as this vid

heres what i have for welding to the viewmodel arm

		if ToolEquipped ~= nil then
			ViewmodelJoint.Part0 = ViewModel:WaitForChild("Right Arm")
		ViewmodelJoint.Part1 = ToolEquipped:WaitForChild("Handle")