Welds and CFrame affecting character

To keep it simple, I want to change the CFrame of a part while it is already welded to the right arm of my character. The problem is that when I change the CFrame of the part after its been welded to my character, the character’s orientation changes as well. I’ve tried to learn more about welds and see similar problems in the dev forum, but I really can’t seem to get it to work.

EquipEvent.OnServerEvent:Connect(function(player, Equipped)

	local character = player.Character or player.CharacterAdded:Wait()
	local RightArm = character:WaitForChild("Right Arm")

	local SwordClone = swordModel:Clone()
	local sword = swordModel:WaitForChild("Sword")
	local swordBase = SwordClone:WaitForChild("Part")

	swordBase.CFrame = RightArm.CFrame * CFrame.new(.1, -.9, -.5) * CFrame.Angles(11,0,0)

	local weld = Instance.new("Weld")
	weld.Part0 = RightArm
	weld.Part1 = swordBase
	weld.C0 = swordBase.CFrame:Inverse() * RightArm.CFrame		
	weld.Parent = character
	SwordClone.Parent = character

end)

a.OnServerEvent:Connect(function(player)	
	
	local character = player.Character
	
	if character:FindFirstChild("Sword Model") then
	
	local character = player.Character
	local humanoid = character:WaitForChild("Humanoid")
	
	print('1')
	
	local sword = character:WaitForChild("Sword Model")
	local sword1 = sword:WaitForChild("Sword")
	local swordBase = sword:WaitForChild("Part")
	local weld = character:WaitForChild("Weld")
	local newCFrame = CFrame.Angles(0, math.rad(45), 0)
	
	sword1.CFrame = newCFrame
	
	wait(.2)
	
	--local anim = humanoid:LoadAnimation(sun)
	--anim:Play()
		
	end	
end)

Feedback appreciated.

1 Like

Tell me if I am wrong I am not sure but try
weld.C0 = swordbase.CFrame:Inverse() * weld.Part1.CFrame

1 Like

I see it like being anchored or somthing

1 Like

This didn’t work, but I checked and nothing’s anchored, but somehow I am transported to my spawn every time I change the CFrame?? I’m definitely confused.

1 Like

Is this CFrame arbitrary ? Because it seems kinda random

It is random, I’m just testing to see if some things I’d like to do in the future would work.

1 Like

Why don’t you use tool in your case it’ll be much easier if its just a sword

I could, I was just testing to see how I could do stuff without them being tools as well. Would making the model a tool be better though?

1 Like