ViewportFrame demo
local Replicated_Storage = game:GetService("ReplicatedStorage")
local Folder = Replicated_Storage:WaitForChild("Folder"):GetChildren()
local ViewportFrame = Replicated_Storage:WaitForChild("ViewportFrame")
print(#Folder)
for i = 1, #Folder do -- loops through all children of Folder
local Clone = Folder[i]:Clone() -- clones the child
local PrimaryPart = Clone.PrimaryPart -- the clones primary part
local Offset = CFrame.new(0, 0, 7) -- the offset
-- cloning and setting up the viewportframe
local ViewportClone = ViewportFrame:Clone()
local Camera = Instance.new("Camera", ViewportFrame)
ViewportClone.CurrentCamera = Camera
Clone.Parent = ViewportClone
ViewportClone.Parent = RotateGui
spawn(function()
while true do
for i = 1, 360 do
Camera.CFrame = PrimaryPart.CFrame CFrame.Angles(0,math.rad(i),0) Offset
wait()
end
end
end)
end
评论