Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a model move in circles?

Im currently working on a game, and i have made a model. I want to make it so the model moves around the circumference of the spawn area, because i will have a surface gui on it to show things from whats going on i dont need to spoil anyhthing though. i know how to make the model move in a straight line but i feel like all i need to do is change a simple equation in the Cframe.new(Thingyhere) part. Here is the script, if you can help out that would be nice. Side note: im new to working with CFrames, most of the stuff i do has to do with Gui's, weapons, animation, and other things used in pretty much every game.

------------------Script---------------------

local Model = script.Parent

while wait() do
 Model:SetPrimaryPartCFrame(Model:GetPrimaryPartCFrame() * CFrame.new(0,0,0 - .1))
end 

Also i can add rotating in later thats not hard :P

1 answer

Use CFrame.Angles to rotate the cframe

local Model = script.Parent

while wait() do
 Model:SetPrimaryPartCFrame(Model:GetPrimaryPartCFrame() * CFrame.new(0,0,-.1) * CFrame.Angles(0,0.01,0))
end 

This discussion is preserved as it was. New answers, comments, and votes are closed.