Parts on tool rotate character

Hi! I am trying to create a tool that has parts on it that I want to rotate whenever I click.
I have tried, but instead it ends up rotating my entire character. Been stuck on this for 2 hours so anything will help!

Code:

local leftSwitches = items.leftSwitches:GetChildren()
local rightSwitches = items.rightSwitches:GetChildren()
--
if not clicked then
	for i, v in pairs(leftSwitches) do
		local cf = CFrame.Angles(0, 0, math.rad(45))
		v.CFrame = v.CFrame:ToObjectSpace(cf)
	end
end

Because you are rotating unanchored Parts with a CFrame. It’ll try to rotate the whole assembly.
Try rotating the C0 or C1 of the welds that hold the Parts on.

Will try this when I get home!

You could even use a Motor or a Motor6D.

This worked, thanks so much! You saved me a ton of time.

1 Like

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