How to Rotate a welded Tool in a player's hand?

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)

1 Like

You can actually animate the tool in the animation editor. Just rename the Handle to BodyAttach (the name doesn’t matter) and disable RequiresHandle on the tool.

Now just put a Motor6D inside the arm you want the sword to be connected to (I personally don’t like renaming it though), and connect it to the BodyAttach (I like to make the Part0 the arm and the Part1 the BodyAttach), and parent the tool inside the dummy. Now just animate!

Now there is one thing left to do, and in a CharacterAdded event, make sure you create a Motor6D inside your arm, and when they equip your tool or unequip your tool, make sure to connect or disconnect it by setting the Part1.

The animation part is a bit confusing to me. I’ve animated the sword and the motor6D seems to work fine, but the only problem is that my sword is sideways. I’ve tried to change the orientation, CFrame, Position, but it wouldn’t move.

Here’s a video of a Motor6D animation Test I did with the Sword tool

It’ll show the Animation and the outcome

Video:

Fixed It, I just had to do CFrame.Angles And change it that way

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.