I Need Help With Rotating Part

So I been working with trying to learn more CFrame and experimenting with ToWorldSpace & ToObjectSpace again and I have been getting it more but fail to apply it, so this is what I am working with:


I have a Ring of these 8 parts but i want to rotate them relatively or locally to their own cframe heres what it would look like:

each part is rotated by 45 degrees locally on their axis, I’ve been attempting for the past 30 minutes and it just keeps positioning the part many studs away and I tried looking at videos about the topic too

If anyone could explain the topic more in depth for this it would help.
I just tried another attempt by not using ToWorldSpace or ToObjectSpace but it rotates half the parts the opposite

for _, part in pairs(script.Parent:GetChildren()) do
	if part:IsA("BasePart") then
		part.CFrame*= CFrame.Angles(0,0,math.rad(45))
	end
end
1 Like

Nevermind I finally figured it out!!!

for i, part in pairs(script.Parent:GetChildren()) do
	local angle = 360/8
	if part:IsA("BasePart") then
		part.CFrame = workspace.Origin.CFrame * CFrame.Angles(math.rad(angle*i),0,math.rad(45)) * CFrame.new(0,15,0) 
	end
end
end

I equally divided up each part to get the angle and manually rotated em around the origin point so all parts are facing the same direction and rotated around the origin then i could finally rotate them individually!, I DID IT!!!

1 Like

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