Problem with rotating saws

i made rotating saws in my game that change position AND also rotate (as previously stated), but the problem is they rotate kind of weirdly, like from side to side, below is the video + the code i used for it to move and rotate (forgot to add this but the saws are a part that contain a mesh inside them)

local TS = game:GetService("TweenService")
local CS = game:GetService("CollectionService")


local sawstable = CS:GetTagged("Saws")--gets all the saws that have this tag

for _, saw in pairs(sawstable) do
	print(sawstable)
	local Info = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,-1,true)
	for i, destinations in saw:GetChildren() do
		if destinations:IsA("BasePart") then
			destination = destinations
		end
	end
	local Goal = {
		Position = destination.Position,
		Orientation = Vector3.new(0,0,360)
	}
	local Tween = TS:Create(saw,Info,Goal)--this is the tween to rotate and move the saws 
	Tween:Play()
end


1 Like

I can’t test the code as I am on mobile at the moment, but it looks to me like the goal for the tween is rotated slightly. Hopefully this helps!

rotated as in that it isnt a straight path to the destination?

No, since you are using a vector3 position, that shouldn’t affect it. Could we see the children of the saw on the explorer tab, and their cframe in game?

alright heres the position properties of the saw part, and its mesh just in case u needed it (tell me if u need the position of the destination part too)


Sorry for being unclear, I wanted to see the destination’s properties in comparison the the actual saw.

1 Like

the actual saw as in the part or the mesh? just making sure

The part, as it has the values being used in the script

1 Like

alright, the first one is the saw’s CFrame properties and the 2nd is the destination’s


Try changing the destination’s orientation to the actual saw (part) orientation.

2 Likes

hmmm nope, it doesnt seem to work, it still does that weird flipping thing

1 Like

Hm, I can’t seem to find another solution other than the one I suggested. Just to make sure, set both orientations to 0, and make sure you’re editing the one under cframe. Sorry for my lack of ideas!

2 Likes

something weird happens, if i set the sawblade to go from side to side instead of back n forth, its orientation doesnt turn like before

Okay, so you should be able to rotate both the destination and the saw to your desired orientation?

1 Like

what do ya mean by that exactly?

When you set them to move from side to side, what did you change exactly? Because I just assumed that you rotated both the saw and the destination 90 degrees.

1 Like

i changed exactly what u said, rotated the saw and the destination 90 degrees

So you’re sure rotating them back won’t fix the issue?

1 Like

mhm, i tried it right now (rotated them back to the starting position) and they keep wobbling from side to side, what i dont understand is why does rotating it 90 degrees fixes it

huh i just found something weird, when i rotate the Y axis on the saw part, all the 3 axis seem to be affected by the change and increasing / decreasing like 0.1 degrees?? (it only does this when i change the Y and X axis*)