I’m confused, how does it rotate it? Like with the animation itself, since the only thing that it seems to be doing is setting it’s orientation to 360, 0, 0, which would be rotating it to be in the same spot, but not really rotating it like a saw
Yes this seems really weird, that your weld still works, even though orientation is overwritten.
Anyways for this to work, you should tween C0
property of the weld, rather than the part itself. I also suggest replacing the weld with Motor6D
, as tweening other welds connected to humanoid result in weird behaviour.
Since C0
is a CFrame property, you cannot use Orientation to tween it. This has a consequence of maximum of 180 turn. CFrame
tweens always use the shortest path to the target orientation. To be able to get full 360 turn you need at least 2 tweens. For an ability to control the direction as well, I suggest a set of 3 tweens.
Here’s how I would do it:
local blade = script.Parent.Parent.PrimaryPart
local rotatingBlade = blade:Clone()
rotatingBlade.Parent = blade.Parent
blade.Transparency = 1
local motor = Instance.new('Motor6D')
motor.Parent = blade
motor.Part0 = blade
motor.Part1 = rotatingBlade
local tweens = {
TS:Create(motor,tweenInfo,{C0 = CFrame.Angles(math.rad(120),0,0)}),
TS:Create(motor,tweenInfo,{C0 = CFrame.Angles(math.rad(240),0,0)}),
TS:Create(motor,tweenInfo,{C0 = CFrame.Angles(0,0,0)}),
}
for i, tween in pairs(tweens) do
tween.Completed:Connect(function()
tweens[i%3 + 1]:Play() --play the next tween
end)
end
tweens[1]:Play() -- start the first tween
You probably want to reduce the length of the tween to 1 second, as each one will make 1/3 of a turn.
If the blade is rotating the wrong way, swap any of the tweens around.
If the blade is rotating in the wrong axis, put math.rad()
in different spot, ie: CFrame.Angles(0,0,math.rad(120))