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.