So I am working on a project and I wanted to create a main menu with a camera that keeps rotating.
The way I am doing it appears to not be working, could anyone give me a solution and possibly explain me how my code didn’t work?
So I made a block rotate and tried updating the camera’s orientation to match the rotation of that block.
Code client:
local mmCam = workspace.CurrentCamera
task.defer(function()
if mmCam.CameraType ~= Enum.CameraType.Scriptable then
repeat wait()
mmCam.CameraType = Enum.CameraType.Scriptable
until mmCam.CameraType == Enum.CameraType.Scriptable
else
mmCam.CFrame = game.Workspace.CameraMainPart.CFrame
while task.wait() do
mmCam.CFrame = CFrame.new(game.Workspace.CameraMainPart.CFrame.Position)*CFrame.Angles(game.Workspace.CameraMainPart.Orientation)
end
end
end)
code rotating part:
task.defer(function()
while task.wait() do
script.Parent.Orientation = script.Parent.Orientation + Vector3.new(0,1,0)
end
end)