Hi! I'm trying to make a part spin around in a perfect circle and here are the things I've tried:
local circle_motion_Z = 0 local circle_motion_X = 0 while true do script.Parent.Position = script.Parent.Position + Vector3.new(circle_motion_X,0,circle_motion_Z) circle_motion_Z = circle_motion_Z + 0.001 circle_motion_X = circle_motion_X + 0.0005 wait(0.01) end
And another one I'd thought work:
while true do script.Parent.Position = script.Parent.Position + Vector3.new(0.1,0,math.pi) wait(0.01) end
I've tried other things but I think those two will be most important in this situation. I don't know if I'm doing this right or wrong, I was thinking about using Tweening
but that probably wouldn't work for moving a part in a circular motion.
Thanks for helping me! ~Chez_Guy :)
My method might be a little messy but is quick to the point.
Using two anchored parts named 'Origin' and 'Orbit' in workspace:
local origin = workspace:WaitForChild("Origin") --The center part we're orbiting local orbit = workspace:WaitForChild("Orbit") --The part that will be moving local i = 0 --Increment while true do --Start at origin then apply an offset using Angles() target.CFrame = CFrame.new(main.Position) * CFrame.Angles(0, i, 0) * CFrame.new(0, 0, 5) --Increment i by 5 degrees every wait() i = i + math.rad(5) wait() end