I’m having trouble getting the right orientation/Rotation of the sword on my players hand. How do I change the rotation of the sword? I’m using a motor6D weld because I want to have an animatable sword.
What it looks like:
SCRIPT:
local Tool = script.Parent.Parent.Parent
local VFXPart = Tool:WaitForChild("VFXPart")
VFXPart.CFrame = Tool.Blade.CFrame
local MotorEvent = script.Parent
local WeldName = "RightMotor6DGrip"---Change the name here if you'd like to
function Tool_Equipped(Character,Tool)
local Handle = Tool:WaitForChild("Handle")
--print("Equipped")
local plr_char = script.Parent.Parent.Parent.Parent
local Right_Arm = plr_char:FindFirstChild("RightHand")
local Right_GripW = Right_Arm:WaitForChild("RightGrip",2)
Right_Weld = Instance.new("Motor6D")
Right_Weld.Part0 = Right_Arm
Right_Weld.Part1 = Handle
-- Right_Weld.C0 = Right_Weld.C0 * CFrame.new(0,0,-1)
-- Right_Weld.C1 = Right_GripW.C1
Right_Weld.Parent = Right_Arm
Right_Weld.Name = WeldName
Right_GripW:Destroy()
end
function Tool_Unequip(Character)
Right_Weld:Destroy()
end
MotorEvent.OnServerEvent:Connect(function(player, info,Char, tool)
if info == "Equipped" then
Tool_Equipped(Char, tool)
print("Successfully Fired Equip")
elseif info == "Unequipped" then
Tool_Unequip(Char, tool)
print("Successfully Fired To UnEquip")
end
end)