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

Making a map rotate constantly?

I've created a map, and modeled it. How would I make it rotate? Like spinning clockwise??

2 answers

✓ Accepted answer
function rotateMod(mod,rotation)
local center = mod:GetModelCFrame()
local parts ={}
local function scan(parent)
for _,obj in pairs(parent:GetChildren()) do
if (obj:IsA("BasePart")) then
table.insert(parts,obj)
end
scan(obj)
end
end
scan(mod)
for _,part in pairs(parts) do
part.CFrame = (center*rotation*(center:inverse()*part.CFrame))
end
end

while true do
wait (0.4)
rotateMod(game.Workspace.Map,CFrame.Angles(0,-0.2,0))
end

Change the Map in "rotateMod(game.Workspace.Map,CFrame.Angles(0,-0.2,0))" To whatever the name of the map model is there you go!

You could use a for loop, constantly adding 1 to the rotation every 0.1 or 0.01 second

for i = 0,math.huge do
	map.Rotation = Vector3.new(0,i,0)
	wait(0.01)
end

This adds 1 to the rotation every 0.01 of a second. I have tried making the map.Rotation = map.Rotation+Vector3.new(0,i,0) but that doesn't seem to have worked

1 comment

0

That wouldn't work because the "Map" would be a model and you can't use that to rotate a model.

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