How to prevent part from shifting position when you are rotating it

Hi everyone, I have this issue where some parts are shifting. I set the orientation of that part to 0,0,0; but it shifts. How could I make it prevent from doing that?

Video that explains my problem :

Here is the script I use to make it go down

while true do
	wait()
	for i,v in pairs(script.Parent:GetDescendants()) do
		for daChildNum, daChild in pairs(v:GetDescendants()) do
			pcall(function()
				daChild.Rotation = Vector3.new(0,0,0)
			end)
		end
	end
end

And here is the script that rotates everything :

script.Parent.PrimaryPart = script.Parent.Parent.Primary
while true do
	wait()

script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0.003,0,0))
end

I’m desperate at this point, any help would be appreciated. Thank you :slight_smile:

2 Likes

I believe this is not an issue with how your rotating the parts (i could be wrong) but maybe your welds or joints between the objects.

I have no joints and no welds. Only anchored.

1 Like

That could be a problem because you are giving it a new position and rotation every few seconds which could cause those issues, I would only move/ rotate the primary part of the model and Weld the Chair together. Or another option would be tween Service which would have a cleaner look but, may be more complex on a circle motion

So basically I have grouped the chairs. It looks like this.
image
I need to weld the seat to the model?

If I understand it correctly, you are rotating the entire ferris wheel along with the seats, then un-rotating every part of every seat. In this case, the issue may be arising because not all of the parts of the seat have the same rotational centre. So when you set the rotation to zero, it doesn’t un-rotate it about the same axis that it was originally rotated, causing a small displacement each time.

You could try de-rotating each entire seat model about the same centre (the pin that connects it to the ferris wheel) by using the negative of your SetPrimaryPartCFrame. Though I’m not sure if this will bring it back to an exact rotation of (0,0,0).

Or you could rotate the ferris wheel frame separately and then move the seats (without rotating them) by calculating points along the circumference of the ferris wheel.

1 Like

Very detailed. Thank you. Your solutions would work.